From ec47557b471d9575d13091ac2f3e8a607146ddfb Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sat, 25 Mar 2023 13:06:22 +0000 Subject: [PATCH] CodeGen from PR 23293 in Azure/azure-rest-api-specs Merge a066af333c20fcf240d3f6edbdedd7f2d5740532 into 2ac8dec9cbc4ad4db7537de603339f069d482078 --- ...esourceManager.EdgeOrder.netstandard2.0.cs | 190 +- .../Generated/EdgeOrderAddressCollection.cs | 90 +- .../src/Generated/EdgeOrderAddressResource.cs | 102 +- .../src/Generated/EdgeOrderCollection.cs | 38 +- .../src/Generated/EdgeOrderData.cs | 6 +- .../src/Generated/EdgeOrderItemCollection.cs | 98 +- .../src/Generated/EdgeOrderItemData.cs | 2 +- .../src/Generated/EdgeOrderItemResource.cs | 142 +- .../src/Generated/EdgeOrderResource.cs | 26 +- .../Extensions/EdgeOrderExtensions.cs | 316 +-- .../ResourceGroupResourceExtensionClient.cs | 52 +- .../SubscriptionResourceExtensionClient.cs | 246 +- .../AdditionalConfiguration.Serialization.cs | 49 + .../Models/AdditionalConfiguration.cs | 33 + .../CategoryInformation.Serialization.cs | 62 + .../Generated/Models/CategoryInformation.cs | 44 + .../ChildConfiguration.Serialization.cs | 236 ++ .../Generated/Models/ChildConfiguration.cs | 96 + .../ChildConfigurationFilter.Serialization.cs | 41 + .../Models/ChildConfigurationFilter.cs | 28 + .../Models/ChildConfigurationType.cs | 51 + ...onfigurationDeviceDetails.Serialization.cs | 88 + .../Models/ConfigurationDeviceDetails.cs | 48 + ...s => ConfigurationFilter.Serialization.cs} | 7 +- ...ationFilters.cs => ConfigurationFilter.cs} | 8 +- .../ConfigurationsContent.Serialization.cs | 8 +- .../Generated/Models/ConfigurationsContent.cs | 14 +- .../Models/EdgeOrderData.Serialization.cs | 13 +- .../Models/EdgeOrderItemAddressDetails.cs | 6 +- .../EdgeOrderItemDetails.Serialization.cs | 29 +- .../Generated/Models/EdgeOrderItemDetails.cs | 16 +- .../Models/EdgeOrderItemReturnContent.cs | 2 +- .../Models/EdgeOrderProduct.Serialization.cs | 13 +- .../src/Generated/Models/EdgeOrderProduct.cs | 12 +- .../EdgeOrderProductBillingMeterDetails.cs | 4 +- .../Models/EdgeOrderProductDeviceDetails.cs | 4 +- .../Models/EdgeOrderProductMeterDetails.cs | 2 +- .../Generated/Models/EdgeOrderStageName.cs | 4 +- .../src/Generated/Models/FulfillmentType.cs | 51 + ...roupedChildConfigurations.Serialization.cs | 55 + .../Models/GroupedChildConfigurations.cs | 36 + .../Generated/Models/IdentificationType.cs | 51 + .../Generated/Models/OrderItemResourceList.cs | 2 +- .../src/Generated/Models/OrderMode.cs | 51 + .../Models/ProductAvailabilityInformation.cs | 4 +- .../Models/ProductAvailabilityStage.cs | 17 +- .../ProductConfiguration.Serialization.cs | 45 +- .../Generated/Models/ProductConfiguration.cs | 20 +- .../Models/ProductDetails.Serialization.cs | 59 +- .../src/Generated/Models/ProductDetails.cs | 29 +- .../ProductFamiliesMetadata.Serialization.cs | 13 +- .../Models/ProductFamiliesMetadata.cs | 10 +- .../Models/ProductFamily.Serialization.cs | 13 +- .../src/Generated/Models/ProductFamily.cs | 10 +- .../Models/ProductLine.Serialization.cs | 13 +- .../src/Generated/Models/ProductLine.cs | 10 +- .../src/Generated/Models/ProductLinkType.cs | 3 + .../Generated/Models/ProductSpecification.cs | 2 +- .../RestOperations/AddressesRestOperations.cs | 690 +++++ .../EdgeOrderManagementRestOperations.cs | 2319 ----------------- .../OrderItemsRestOperations.cs | 870 +++++++ .../RestOperations/OrdersRestOperations.cs | 438 ++++ ...ProductsAndConfigurationsRestOperations.cs | 501 ++++ .../src/autorest.md | 2 +- 64 files changed, 4543 insertions(+), 2997 deletions(-) create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/AdditionalConfiguration.Serialization.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/AdditionalConfiguration.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/CategoryInformation.Serialization.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/CategoryInformation.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfiguration.Serialization.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfiguration.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfigurationFilter.Serialization.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfigurationFilter.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfigurationType.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationDeviceDetails.Serialization.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationDeviceDetails.cs rename sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/{ConfigurationFilters.Serialization.cs => ConfigurationFilter.Serialization.cs} (75%) rename sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/{ConfigurationFilters.cs => ConfigurationFilter.cs} (69%) create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/FulfillmentType.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/GroupedChildConfigurations.Serialization.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/GroupedChildConfigurations.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/IdentificationType.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/OrderMode.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/AddressesRestOperations.cs delete mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/EdgeOrderManagementRestOperations.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/OrderItemsRestOperations.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/OrdersRestOperations.cs create mode 100644 sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/ProductsAndConfigurationsRestOperations.cs diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/api/Azure.ResourceManager.EdgeOrder.netstandard2.0.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/api/Azure.ResourceManager.EdgeOrder.netstandard2.0.cs index 9f024af233cd..3d9a7012e6fb 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/api/Azure.ResourceManager.EdgeOrder.netstandard2.0.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/api/Azure.ResourceManager.EdgeOrder.netstandard2.0.cs @@ -8,8 +8,8 @@ protected EdgeOrderAddressCollection() { } public virtual Azure.Response Exists(string addressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string addressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string addressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, string skipToken = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, string skipToken = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string addressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } @@ -55,36 +55,37 @@ public partial class EdgeOrderData : Azure.ResourceManager.Models.ResourceData public EdgeOrderData() { } public Azure.ResourceManager.EdgeOrder.Models.EdgeOrderStageDetails CurrentStage { get { throw null; } } public System.Collections.Generic.IReadOnlyList OrderItemIds { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.OrderMode? OrderMode { get { throw null; } } public System.Collections.Generic.IReadOnlyList OrderStageHistory { get { throw null; } } } public static partial class EdgeOrderExtensions { - public static Azure.Pageable GetConfigurations(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.EdgeOrder.Models.ConfigurationsContent content, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetConfigurationsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.EdgeOrder.Models.ConfigurationsContent content, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetConfigurationsProductsAndConfigurations(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.EdgeOrder.Models.ConfigurationsContent content, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetConfigurationsProductsAndConfigurationsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.EdgeOrder.Models.ConfigurationsContent content, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetEdgeOrder(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location, string orderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetEdgeOrderAddress(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string addressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetEdgeOrderAddressAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string addressName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.EdgeOrder.EdgeOrderAddressCollection GetEdgeOrderAddresses(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetEdgeOrderAddresses(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetEdgeOrderAddressesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetEdgeOrderAddresses(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, string skipToken = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetEdgeOrderAddressesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, string skipToken = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.EdgeOrder.EdgeOrderAddressResource GetEdgeOrderAddressResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static System.Threading.Tasks.Task> GetEdgeOrderAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.Core.AzureLocation location, string orderName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetEdgeOrderItem(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string orderItemName, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetEdgeOrderItemAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string orderItemName, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.EdgeOrder.EdgeOrderItemResource GetEdgeOrderItemResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.EdgeOrder.EdgeOrderItemCollection GetEdgeOrderItems(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetEdgeOrderItems(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, string expand = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetEdgeOrderItemsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, string expand = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetEdgeOrderItems(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, string expand = null, string skipToken = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetEdgeOrderItemsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string filter = null, string expand = null, string skipToken = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.EdgeOrder.EdgeOrderResource GetEdgeOrderResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.EdgeOrder.EdgeOrderCollection GetEdgeOrders(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } - public static Azure.Pageable GetEdgeOrders(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Pageable GetEdgeOrders(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetEdgeOrdersAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetEdgeOrdersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Pageable GetProductFamilies(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.EdgeOrder.Models.ProductFamiliesContent content, string expand = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetProductFamiliesAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.EdgeOrder.Models.ProductFamiliesContent content, string expand = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.Pageable GetProductFamiliesMetadata(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.AsyncPageable GetProductFamiliesMetadataAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetEdgeOrders(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string skipToken = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetEdgeOrders(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skipToken = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetEdgeOrdersAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string skipToken = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetEdgeOrdersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skipToken = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetProductFamiliesMetadataProductsAndConfigurations(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetProductFamiliesMetadataProductsAndConfigurationsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Pageable GetProductFamiliesProductsAndConfigurations(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.EdgeOrder.Models.ProductFamiliesContent content, string expand = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetProductFamiliesProductsAndConfigurationsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.ResourceManager.EdgeOrder.Models.ProductFamiliesContent content, string expand = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class EdgeOrderItemCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -94,8 +95,8 @@ protected EdgeOrderItemCollection() { } public virtual Azure.Response Exists(string orderItemName, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string orderItemName, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(string orderItemName, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string filter = null, string expand = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string filter = null, string expand = null, string skipToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string filter = null, string expand = null, string skipToken = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string filter = null, string expand = null, string skipToken = null, int? top = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(string orderItemName, string expand = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } @@ -146,16 +147,84 @@ protected EdgeOrderResource() { } } namespace Azure.ResourceManager.EdgeOrder.Models { - public partial class ConfigurationFilters + public partial class AdditionalConfiguration { - public ConfigurationFilters(Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation hierarchyInformation) { } + public AdditionalConfiguration(Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation hierarchyInformation, int quantity) { } + public Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation HierarchyInformation { get { throw null; } set { } } + public int Quantity { get { throw null; } set { } } + } + public partial class CategoryInformation + { + internal CategoryInformation() { } + public string CategoryDisplayName { get { throw null; } } + public string CategoryName { get { throw null; } } + public string Description { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Links { get { throw null; } } + } + public partial class ChildConfiguration + { + internal ChildConfiguration() { } + public Azure.ResourceManager.EdgeOrder.Models.ProductAvailabilityInformation AvailabilityInformation { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.ChildConfigurationType? ChildConfigurationType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ChildConfigurationTypes { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.EdgeOrderProductCostInformation CostInformation { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.ProductDescription Description { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.ProductDimensions Dimensions { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList FilterableProperties { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.FulfillmentType? FulfilledBy { get { throw null; } } + public System.Collections.Generic.IReadOnlyList GroupedChildConfigurations { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation HierarchyInformation { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ImageInformation { get { throw null; } } + public bool? IsPartOfBaseConfiguration { get { throw null; } } + public int? MaximumQuantity { get { throw null; } } + public int? MinimumQuantity { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Specifications { get { throw null; } } + } + public partial class ChildConfigurationFilter + { + public ChildConfigurationFilter() { } + public System.Collections.Generic.IList ChildConfigurationTypes { get { throw null; } } + public System.Collections.Generic.IList HierarchyInformations { get { throw null; } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ChildConfigurationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ChildConfigurationType(string value) { throw null; } + public static Azure.ResourceManager.EdgeOrder.Models.ChildConfigurationType AdditionalConfiguration { get { throw null; } } + public static Azure.ResourceManager.EdgeOrder.Models.ChildConfigurationType DeviceConfiguration { get { throw null; } } + public bool Equals(Azure.ResourceManager.EdgeOrder.Models.ChildConfigurationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.EdgeOrder.Models.ChildConfigurationType left, Azure.ResourceManager.EdgeOrder.Models.ChildConfigurationType right) { throw null; } + public static implicit operator Azure.ResourceManager.EdgeOrder.Models.ChildConfigurationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.EdgeOrder.Models.ChildConfigurationType left, Azure.ResourceManager.EdgeOrder.Models.ChildConfigurationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ConfigurationDeviceDetails + { + internal ConfigurationDeviceDetails() { } + public System.Collections.Generic.IReadOnlyList DeviceDetails { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.ProductDisplayInfo DisplayInfo { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation HierarchyInformation { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.IdentificationType? IdentificationType { get { throw null; } } + public int? Quantity { get { throw null; } } + } + public partial class ConfigurationFilter + { + public ConfigurationFilter(Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation hierarchyInformation) { } + public Azure.ResourceManager.EdgeOrder.Models.ChildConfigurationFilter ChildConfigurationFilter { get { throw null; } set { } } public System.Collections.Generic.IList FilterableProperty { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation HierarchyInformation { get { throw null; } } } public partial class ConfigurationsContent { - public ConfigurationsContent(System.Collections.Generic.IEnumerable configurationFilters) { } - public System.Collections.Generic.IList ConfigurationFilters { get { throw null; } } + public ConfigurationsContent() { } + public Azure.ResourceManager.EdgeOrder.Models.ConfigurationFilter ConfigurationFilter { get { throw null; } set { } } public Azure.ResourceManager.EdgeOrder.Models.CustomerSubscriptionDetails CustomerSubscriptionDetails { get { throw null; } set { } } } public partial class CustomerSubscriptionDetails @@ -287,10 +356,10 @@ public EdgeOrderItemDetails(Azure.ResourceManager.EdgeOrder.Models.ProductDetail public Azure.ResourceManager.EdgeOrder.Models.EdgeOrderStageDetails CurrentStage { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.EdgeOrderActionStatus? DeletionStatus { get { throw null; } } public Azure.ResponseError Error { get { throw null; } } - public string FirstOrDefaultManagementResourceProviderNamespace { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.ForwardShippingDetails ForwardShippingDetails { get { throw null; } } public System.Collections.Generic.IReadOnlyList ManagementRPDetailsList { get { throw null; } } public System.Collections.Generic.IList NotificationEmailList { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.OrderMode? OrderItemMode { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList OrderItemStageHistory { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.OrderItemType OrderItemType { get { throw null; } set { } } public Azure.ResourceManager.EdgeOrder.Models.OrderItemPreferences Preferences { get { throw null; } set { } } @@ -324,6 +393,7 @@ internal EdgeOrderProduct() { } public Azure.ResourceManager.EdgeOrder.Models.ProductDescription Description { get { throw null; } } public string DisplayName { get { throw null; } } public System.Collections.Generic.IReadOnlyList FilterableProperties { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.FulfillmentType? FulfilledBy { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation HierarchyInformation { get { throw null; } } public System.Collections.Generic.IReadOnlyList ImageInformation { get { throw null; } } } @@ -502,6 +572,30 @@ internal ForwardShippingDetails() { } public string TrackingId { get { throw null; } } public System.Uri TrackingUri { get { throw null; } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct FulfillmentType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public FulfillmentType(string value) { throw null; } + public static Azure.ResourceManager.EdgeOrder.Models.FulfillmentType External { get { throw null; } } + public static Azure.ResourceManager.EdgeOrder.Models.FulfillmentType Microsoft { get { throw null; } } + public bool Equals(Azure.ResourceManager.EdgeOrder.Models.FulfillmentType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.EdgeOrder.Models.FulfillmentType left, Azure.ResourceManager.EdgeOrder.Models.FulfillmentType right) { throw null; } + public static implicit operator Azure.ResourceManager.EdgeOrder.Models.FulfillmentType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.EdgeOrder.Models.FulfillmentType left, Azure.ResourceManager.EdgeOrder.Models.FulfillmentType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class GroupedChildConfigurations + { + internal GroupedChildConfigurations() { } + public Azure.ResourceManager.EdgeOrder.Models.CategoryInformation CategoryInformation { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ChildConfigurations { get { throw null; } } + } public partial class HierarchyInformation { public HierarchyInformation() { } @@ -510,6 +604,24 @@ public HierarchyInformation() { } public string ProductLineName { get { throw null; } set { } } public string ProductName { get { throw null; } set { } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IdentificationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IdentificationType(string value) { throw null; } + public static Azure.ResourceManager.EdgeOrder.Models.IdentificationType NotSupported { get { throw null; } } + public static Azure.ResourceManager.EdgeOrder.Models.IdentificationType SerialNumber { get { throw null; } } + public bool Equals(Azure.ResourceManager.EdgeOrder.Models.IdentificationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.EdgeOrder.Models.IdentificationType left, Azure.ResourceManager.EdgeOrder.Models.IdentificationType right) { throw null; } + public static implicit operator Azure.ResourceManager.EdgeOrder.Models.IdentificationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.EdgeOrder.Models.IdentificationType left, Azure.ResourceManager.EdgeOrder.Models.IdentificationType right) { throw null; } + public override string ToString() { throw null; } + } public partial class NotificationPreference { public NotificationPreference(Azure.ResourceManager.EdgeOrder.Models.NotificationStageName stageName, bool isNotificationRequired) { } @@ -598,6 +710,24 @@ public OrderItemPreferences() { } public static bool operator !=(Azure.ResourceManager.EdgeOrder.Models.OrderItemType left, Azure.ResourceManager.EdgeOrder.Models.OrderItemType right) { throw null; } public override string ToString() { throw null; } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct OrderMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public OrderMode(string value) { throw null; } + public static Azure.ResourceManager.EdgeOrder.Models.OrderMode Default { get { throw null; } } + public static Azure.ResourceManager.EdgeOrder.Models.OrderMode DoNotFulfill { get { throw null; } } + public bool Equals(Azure.ResourceManager.EdgeOrder.Models.OrderMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.EdgeOrder.Models.OrderMode left, Azure.ResourceManager.EdgeOrder.Models.OrderMode right) { throw null; } + public static implicit operator Azure.ResourceManager.EdgeOrder.Models.OrderMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.EdgeOrder.Models.OrderMode left, Azure.ResourceManager.EdgeOrder.Models.OrderMode right) { throw null; } + public override string ToString() { throw null; } + } public partial class Pav2MeterDetails : Azure.ResourceManager.EdgeOrder.Models.EdgeOrderProductMeterDetails { internal Pav2MeterDetails() { } @@ -619,6 +749,7 @@ internal ProductAvailabilityInformation() { } public static Azure.ResourceManager.EdgeOrder.Models.ProductAvailabilityStage Available { get { throw null; } } public static Azure.ResourceManager.EdgeOrder.Models.ProductAvailabilityStage ComingSoon { get { throw null; } } public static Azure.ResourceManager.EdgeOrder.Models.ProductAvailabilityStage Deprecated { get { throw null; } } + public static Azure.ResourceManager.EdgeOrder.Models.ProductAvailabilityStage Discoverable { get { throw null; } } public static Azure.ResourceManager.EdgeOrder.Models.ProductAvailabilityStage Preview { get { throw null; } } public static Azure.ResourceManager.EdgeOrder.Models.ProductAvailabilityStage SignUp { get { throw null; } } public static Azure.ResourceManager.EdgeOrder.Models.ProductAvailabilityStage Unavailable { get { throw null; } } @@ -636,11 +767,14 @@ public partial class ProductConfiguration { internal ProductConfiguration() { } public Azure.ResourceManager.EdgeOrder.Models.ProductAvailabilityInformation AvailabilityInformation { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ChildConfigurationTypes { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.EdgeOrderProductCostInformation CostInformation { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.ProductDescription Description { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.ProductDimensions Dimensions { get { throw null; } } public string DisplayName { get { throw null; } } public System.Collections.Generic.IReadOnlyList FilterableProperties { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.FulfillmentType? FulfilledBy { get { throw null; } } + public System.Collections.Generic.IReadOnlyList GroupedChildConfigurations { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation HierarchyInformation { get { throw null; } } public System.Collections.Generic.IReadOnlyList ImageInformation { get { throw null; } } public System.Collections.Generic.IReadOnlyList Specifications { get { throw null; } } @@ -675,10 +809,12 @@ internal ProductDescription() { } public partial class ProductDetails { public ProductDetails(Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation hierarchyInformation) { } - public int? Count { get { throw null; } } - public System.Collections.Generic.IReadOnlyList DeviceDetails { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ChildConfigurationDeviceDetails { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.ProductDisplayInfo DisplayInfo { get { throw null; } set { } } public Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation HierarchyInformation { get { throw null; } set { } } + public Azure.ResourceManager.EdgeOrder.Models.IdentificationType? IdentificationType { get { throw null; } } + public System.Collections.Generic.IList OptInAdditionalConfigurations { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.EdgeOrderProductDeviceDetails ParentDeviceDetails { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.DoubleEncryptionStatus? ProductDoubleEncryptionStatus { get { throw null; } } } public partial class ProductDimensions @@ -736,6 +872,7 @@ internal ProductFamiliesMetadata() { } public Azure.ResourceManager.EdgeOrder.Models.ProductDescription Description { get { throw null; } } public string DisplayName { get { throw null; } } public System.Collections.Generic.IReadOnlyList FilterableProperties { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.FulfillmentType? FulfilledBy { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation HierarchyInformation { get { throw null; } } public System.Collections.Generic.IReadOnlyList ImageInformation { get { throw null; } } public System.Collections.Generic.IReadOnlyList ProductLines { get { throw null; } } @@ -749,6 +886,7 @@ internal ProductFamily() { } public Azure.ResourceManager.EdgeOrder.Models.ProductDescription Description { get { throw null; } } public string DisplayName { get { throw null; } } public System.Collections.Generic.IReadOnlyList FilterableProperties { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.FulfillmentType? FulfilledBy { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation HierarchyInformation { get { throw null; } } public System.Collections.Generic.IReadOnlyList ImageInformation { get { throw null; } } public System.Collections.Generic.IReadOnlyList ProductLines { get { throw null; } } @@ -780,6 +918,7 @@ internal ProductLine() { } public Azure.ResourceManager.EdgeOrder.Models.ProductDescription Description { get { throw null; } } public string DisplayName { get { throw null; } } public System.Collections.Generic.IReadOnlyList FilterableProperties { get { throw null; } } + public Azure.ResourceManager.EdgeOrder.Models.FulfillmentType? FulfilledBy { get { throw null; } } public Azure.ResourceManager.EdgeOrder.Models.HierarchyInformation HierarchyInformation { get { throw null; } } public System.Collections.Generic.IReadOnlyList ImageInformation { get { throw null; } } public System.Collections.Generic.IReadOnlyList Products { get { throw null; } } @@ -796,6 +935,7 @@ internal ProductLink() { } private readonly object _dummy; private readonly int _dummyPrimitive; public ProductLinkType(string value) { throw null; } + public static Azure.ResourceManager.EdgeOrder.Models.ProductLinkType Discoverable { get { throw null; } } public static Azure.ResourceManager.EdgeOrder.Models.ProductLinkType Documentation { get { throw null; } } public static Azure.ResourceManager.EdgeOrder.Models.ProductLinkType Generic { get { throw null; } } public static Azure.ResourceManager.EdgeOrder.Models.ProductLinkType KnowMore { get { throw null; } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderAddressCollection.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderAddressCollection.cs index 5586afa2d820..db7a73af632c 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderAddressCollection.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderAddressCollection.cs @@ -26,8 +26,8 @@ namespace Azure.ResourceManager.EdgeOrder /// public partial class EdgeOrderAddressCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _edgeOrderAddressClientDiagnostics; - private readonly EdgeOrderManagementRestOperations _edgeOrderAddressRestClient; + private readonly ClientDiagnostics _edgeOrderAddressAddressesClientDiagnostics; + private readonly AddressesRestOperations _edgeOrderAddressAddressesRestClient; /// Initializes a new instance of the class for mocking. protected EdgeOrderAddressCollection() @@ -39,9 +39,9 @@ protected EdgeOrderAddressCollection() /// The identifier of the parent resource that is the target of operations. internal EdgeOrderAddressCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _edgeOrderAddressClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", EdgeOrderAddressResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(EdgeOrderAddressResource.ResourceType, out string edgeOrderAddressApiVersion); - _edgeOrderAddressRestClient = new EdgeOrderManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, edgeOrderAddressApiVersion); + _edgeOrderAddressAddressesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", EdgeOrderAddressResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EdgeOrderAddressResource.ResourceType, out string edgeOrderAddressAddressesApiVersion); + _edgeOrderAddressAddressesRestClient = new AddressesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, edgeOrderAddressAddressesApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -54,7 +54,8 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Creates a new address with the specified parameters. Existing address can be updated with this API + /// Create a new address with the specified parameters. Existing address cannot be updated with this API and should + /// instead be updated with the Update address API. /// /// /// Request Path @@ -62,7 +63,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// CreateAddress + /// Addresses_Create /// /// /// @@ -77,12 +78,12 @@ public virtual async Task> CreateOrUpdate Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressCollection.CreateOrUpdate"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _edgeOrderAddressRestClient.CreateAddressAsync(Id.SubscriptionId, Id.ResourceGroupName, addressName, data, cancellationToken).ConfigureAwait(false); - var operation = new EdgeOrderArmOperation(new EdgeOrderAddressOperationSource(Client), _edgeOrderAddressClientDiagnostics, Pipeline, _edgeOrderAddressRestClient.CreateCreateAddressRequest(Id.SubscriptionId, Id.ResourceGroupName, addressName, data).Request, response, OperationFinalStateVia.Location); + var response = await _edgeOrderAddressAddressesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, addressName, data, cancellationToken).ConfigureAwait(false); + var operation = new EdgeOrderArmOperation(new EdgeOrderAddressOperationSource(Client), _edgeOrderAddressAddressesClientDiagnostics, Pipeline, _edgeOrderAddressAddressesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, addressName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -95,7 +96,8 @@ public virtual async Task> CreateOrUpdate } /// - /// Creates a new address with the specified parameters. Existing address can be updated with this API + /// Create a new address with the specified parameters. Existing address cannot be updated with this API and should + /// instead be updated with the Update address API. /// /// /// Request Path @@ -103,7 +105,7 @@ public virtual async Task> CreateOrUpdate /// /// /// Operation Id - /// CreateAddress + /// Addresses_Create /// /// /// @@ -118,12 +120,12 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressCollection.CreateOrUpdate"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressCollection.CreateOrUpdate"); scope.Start(); try { - var response = _edgeOrderAddressRestClient.CreateAddress(Id.SubscriptionId, Id.ResourceGroupName, addressName, data, cancellationToken); - var operation = new EdgeOrderArmOperation(new EdgeOrderAddressOperationSource(Client), _edgeOrderAddressClientDiagnostics, Pipeline, _edgeOrderAddressRestClient.CreateCreateAddressRequest(Id.SubscriptionId, Id.ResourceGroupName, addressName, data).Request, response, OperationFinalStateVia.Location); + var response = _edgeOrderAddressAddressesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, addressName, data, cancellationToken); + var operation = new EdgeOrderArmOperation(new EdgeOrderAddressOperationSource(Client), _edgeOrderAddressAddressesClientDiagnostics, Pipeline, _edgeOrderAddressAddressesRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, addressName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -136,7 +138,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w } /// - /// Gets information about the specified address. + /// Get information about the specified address. /// /// /// Request Path @@ -144,7 +146,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// @@ -156,11 +158,11 @@ public virtual async Task> GetAsync(string ad { Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressCollection.Get"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressCollection.Get"); scope.Start(); try { - var response = await _edgeOrderAddressRestClient.GetAddressByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, addressName, cancellationToken).ConfigureAwait(false); + var response = await _edgeOrderAddressAddressesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, addressName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new EdgeOrderAddressResource(Client, response.Value), response.GetRawResponse()); @@ -173,7 +175,7 @@ public virtual async Task> GetAsync(string ad } /// - /// Gets information about the specified address. + /// Get information about the specified address. /// /// /// Request Path @@ -181,7 +183,7 @@ public virtual async Task> GetAsync(string ad /// /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// @@ -193,11 +195,11 @@ public virtual Response Get(string addressName, Cancel { Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressCollection.Get"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressCollection.Get"); scope.Start(); try { - var response = _edgeOrderAddressRestClient.GetAddressByName(Id.SubscriptionId, Id.ResourceGroupName, addressName, cancellationToken); + var response = _edgeOrderAddressAddressesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, addressName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new EdgeOrderAddressResource(Client, response.Value), response.GetRawResponse()); @@ -210,7 +212,7 @@ public virtual Response Get(string addressName, Cancel } /// - /// Lists all the addresses available under the given resource group. + /// List all the addresses available under the given resource group. /// /// /// Request Path @@ -218,23 +220,24 @@ public virtual Response Get(string addressName, Cancel /// /// /// Operation Id - /// ListAddressesAtResourceGroupLevel + /// Addresses_ListByResourceGroup /// /// /// /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. - /// $skipToken is supported on Get list of addresses, which provides the next page in the list of address. + /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _edgeOrderAddressRestClient.CreateListAddressesAtResourceGroupLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, filter, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _edgeOrderAddressRestClient.CreateListAddressesAtResourceGroupLevelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, filter, skipToken); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderAddressResource(Client, EdgeOrderAddressData.DeserializeEdgeOrderAddressData(e)), _edgeOrderAddressClientDiagnostics, Pipeline, "EdgeOrderAddressCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _edgeOrderAddressAddressesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, filter, skipToken, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _edgeOrderAddressAddressesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, filter, skipToken, top); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderAddressResource(Client, EdgeOrderAddressData.DeserializeEdgeOrderAddressData(e)), _edgeOrderAddressAddressesClientDiagnostics, Pipeline, "EdgeOrderAddressCollection.GetAll", "value", "nextLink", cancellationToken); } /// - /// Lists all the addresses available under the given resource group. + /// List all the addresses available under the given resource group. /// /// /// Request Path @@ -242,19 +245,20 @@ public virtual AsyncPageable GetAllAsync(string filter /// /// /// Operation Id - /// ListAddressesAtResourceGroupLevel + /// Addresses_ListByResourceGroup /// /// /// /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. - /// $skipToken is supported on Get list of addresses, which provides the next page in the list of address. + /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _edgeOrderAddressRestClient.CreateListAddressesAtResourceGroupLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, filter, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _edgeOrderAddressRestClient.CreateListAddressesAtResourceGroupLevelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, filter, skipToken); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderAddressResource(Client, EdgeOrderAddressData.DeserializeEdgeOrderAddressData(e)), _edgeOrderAddressClientDiagnostics, Pipeline, "EdgeOrderAddressCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _edgeOrderAddressAddressesRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, filter, skipToken, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _edgeOrderAddressAddressesRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, filter, skipToken, top); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderAddressResource(Client, EdgeOrderAddressData.DeserializeEdgeOrderAddressData(e)), _edgeOrderAddressAddressesClientDiagnostics, Pipeline, "EdgeOrderAddressCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -266,7 +270,7 @@ public virtual Pageable GetAll(string filter = null, s /// /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// @@ -278,11 +282,11 @@ public virtual async Task> ExistsAsync(string addressName, Cancel { Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressCollection.Exists"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressCollection.Exists"); scope.Start(); try { - var response = await _edgeOrderAddressRestClient.GetAddressByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, addressName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _edgeOrderAddressAddressesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, addressName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -301,7 +305,7 @@ public virtual async Task> ExistsAsync(string addressName, Cancel /// /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// @@ -313,11 +317,11 @@ public virtual Response Exists(string addressName, CancellationToken cance { Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressCollection.Exists"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressCollection.Exists"); scope.Start(); try { - var response = _edgeOrderAddressRestClient.GetAddressByName(Id.SubscriptionId, Id.ResourceGroupName, addressName, cancellationToken: cancellationToken); + var response = _edgeOrderAddressAddressesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, addressName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderAddressResource.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderAddressResource.cs index ba8927773624..03c62c77d73b 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderAddressResource.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderAddressResource.cs @@ -34,8 +34,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _edgeOrderAddressClientDiagnostics; - private readonly EdgeOrderManagementRestOperations _edgeOrderAddressRestClient; + private readonly ClientDiagnostics _edgeOrderAddressAddressesClientDiagnostics; + private readonly AddressesRestOperations _edgeOrderAddressAddressesRestClient; private readonly EdgeOrderAddressData _data; /// Initializes a new instance of the class for mocking. @@ -57,9 +57,9 @@ internal EdgeOrderAddressResource(ArmClient client, EdgeOrderAddressData data) : /// The identifier of the resource that is the target of operations. internal EdgeOrderAddressResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _edgeOrderAddressClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string edgeOrderAddressApiVersion); - _edgeOrderAddressRestClient = new EdgeOrderManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, edgeOrderAddressApiVersion); + _edgeOrderAddressAddressesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string edgeOrderAddressAddressesApiVersion); + _edgeOrderAddressAddressesRestClient = new AddressesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, edgeOrderAddressAddressesApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Gets information about the specified address. + /// Get information about the specified address. /// /// /// Request Path @@ -98,18 +98,18 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressResource.Get"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressResource.Get"); scope.Start(); try { - var response = await _edgeOrderAddressRestClient.GetAddressByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _edgeOrderAddressAddressesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new EdgeOrderAddressResource(Client, response.Value), response.GetRawResponse()); @@ -122,7 +122,7 @@ public virtual async Task> GetAsync(Cancellat } /// - /// Gets information about the specified address. + /// Get information about the specified address. /// /// /// Request Path @@ -130,18 +130,18 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressResource.Get"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressResource.Get"); scope.Start(); try { - var response = _edgeOrderAddressRestClient.GetAddressByName(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _edgeOrderAddressAddressesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new EdgeOrderAddressResource(Client, response.Value), response.GetRawResponse()); @@ -154,7 +154,7 @@ public virtual Response Get(CancellationToken cancella } /// - /// Deletes an address. + /// Delete an address. /// /// /// Request Path @@ -162,7 +162,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Operation Id - /// DeleteAddressByName + /// Addresses_Delete /// /// /// @@ -170,12 +170,12 @@ public virtual Response Get(CancellationToken cancella /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressResource.Delete"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressResource.Delete"); scope.Start(); try { - var response = await _edgeOrderAddressRestClient.DeleteAddressByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new EdgeOrderArmOperation(_edgeOrderAddressClientDiagnostics, Pipeline, _edgeOrderAddressRestClient.CreateDeleteAddressByNameRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _edgeOrderAddressAddressesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new EdgeOrderArmOperation(_edgeOrderAddressAddressesClientDiagnostics, Pipeline, _edgeOrderAddressAddressesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -188,7 +188,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes an address. + /// Delete an address. /// /// /// Request Path @@ -196,7 +196,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// DeleteAddressByName + /// Addresses_Delete /// /// /// @@ -204,12 +204,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressResource.Delete"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressResource.Delete"); scope.Start(); try { - var response = _edgeOrderAddressRestClient.DeleteAddressByName(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new EdgeOrderArmOperation(_edgeOrderAddressClientDiagnostics, Pipeline, _edgeOrderAddressRestClient.CreateDeleteAddressByNameRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _edgeOrderAddressAddressesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new EdgeOrderArmOperation(_edgeOrderAddressAddressesClientDiagnostics, Pipeline, _edgeOrderAddressAddressesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -222,7 +222,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Updates the properties of an existing address. + /// Update the properties of an existing address. /// /// /// Request Path @@ -230,7 +230,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// UpdateAddress + /// Addresses_Update /// /// /// @@ -243,12 +243,12 @@ public virtual async Task> UpdateAsync(Wa { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressResource.Update"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressResource.Update"); scope.Start(); try { - var response = await _edgeOrderAddressRestClient.UpdateAddressAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new EdgeOrderArmOperation(new EdgeOrderAddressOperationSource(Client), _edgeOrderAddressClientDiagnostics, Pipeline, _edgeOrderAddressRestClient.CreateUpdateAddressRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + var response = await _edgeOrderAddressAddressesRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new EdgeOrderArmOperation(new EdgeOrderAddressOperationSource(Client), _edgeOrderAddressAddressesClientDiagnostics, Pipeline, _edgeOrderAddressAddressesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -261,7 +261,7 @@ public virtual async Task> UpdateAsync(Wa } /// - /// Updates the properties of an existing address. + /// Update the properties of an existing address. /// /// /// Request Path @@ -269,7 +269,7 @@ public virtual async Task> UpdateAsync(Wa /// /// /// Operation Id - /// UpdateAddress + /// Addresses_Update /// /// /// @@ -282,12 +282,12 @@ public virtual ArmOperation Update(WaitUntil waitUntil { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressResource.Update"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressResource.Update"); scope.Start(); try { - var response = _edgeOrderAddressRestClient.UpdateAddress(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken); - var operation = new EdgeOrderArmOperation(new EdgeOrderAddressOperationSource(Client), _edgeOrderAddressClientDiagnostics, Pipeline, _edgeOrderAddressRestClient.CreateUpdateAddressRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + var response = _edgeOrderAddressAddressesRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken); + var operation = new EdgeOrderArmOperation(new EdgeOrderAddressOperationSource(Client), _edgeOrderAddressAddressesClientDiagnostics, Pipeline, _edgeOrderAddressAddressesRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -308,7 +308,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil /// /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// @@ -321,7 +321,7 @@ public virtual async Task> AddTagAsync(string Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressResource.AddTag"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressResource.AddTag"); scope.Start(); try { @@ -330,7 +330,7 @@ public virtual async Task> AddTagAsync(string var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _edgeOrderAddressRestClient.GetAddressByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _edgeOrderAddressAddressesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new EdgeOrderAddressResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -362,7 +362,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// @@ -375,7 +375,7 @@ public virtual Response AddTag(string key, string valu Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressResource.AddTag"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressResource.AddTag"); scope.Start(); try { @@ -384,7 +384,7 @@ public virtual Response AddTag(string key, string valu var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _edgeOrderAddressRestClient.GetAddressByName(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var originalResponse = _edgeOrderAddressAddressesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); return Response.FromValue(new EdgeOrderAddressResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -416,7 +416,7 @@ public virtual Response AddTag(string key, string valu /// /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// @@ -427,7 +427,7 @@ public virtual async Task> SetTagsAsync(IDict { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressResource.SetTags"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressResource.SetTags"); scope.Start(); try { @@ -437,7 +437,7 @@ public virtual async Task> SetTagsAsync(IDict var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _edgeOrderAddressRestClient.GetAddressByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _edgeOrderAddressAddressesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new EdgeOrderAddressResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -465,7 +465,7 @@ public virtual async Task> SetTagsAsync(IDict /// /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// @@ -476,7 +476,7 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary SetTags(IDictionary /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// @@ -525,7 +525,7 @@ public virtual async Task> RemoveTagAsync(str { Argument.AssertNotNull(key, nameof(key)); - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressResource.RemoveTag"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressResource.RemoveTag"); scope.Start(); try { @@ -534,7 +534,7 @@ public virtual async Task> RemoveTagAsync(str var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _edgeOrderAddressRestClient.GetAddressByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var originalResponse = await _edgeOrderAddressAddressesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return Response.FromValue(new EdgeOrderAddressResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -566,7 +566,7 @@ public virtual async Task> RemoveTagAsync(str /// /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// @@ -577,7 +577,7 @@ public virtual Response RemoveTag(string key, Cancella { Argument.AssertNotNull(key, nameof(key)); - using var scope = _edgeOrderAddressClientDiagnostics.CreateScope("EdgeOrderAddressResource.RemoveTag"); + using var scope = _edgeOrderAddressAddressesClientDiagnostics.CreateScope("EdgeOrderAddressResource.RemoveTag"); scope.Start(); try { @@ -586,7 +586,7 @@ public virtual Response RemoveTag(string key, Cancella var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _edgeOrderAddressRestClient.GetAddressByName(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var originalResponse = _edgeOrderAddressAddressesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); return Response.FromValue(new EdgeOrderAddressResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderCollection.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderCollection.cs index 06d4d1b47073..d7fb5e92f90e 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderCollection.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderCollection.cs @@ -24,8 +24,8 @@ namespace Azure.ResourceManager.EdgeOrder /// public partial class EdgeOrderCollection : ArmCollection { - private readonly ClientDiagnostics _edgeOrderClientDiagnostics; - private readonly EdgeOrderManagementRestOperations _edgeOrderRestClient; + private readonly ClientDiagnostics _edgeOrderOrdersClientDiagnostics; + private readonly OrdersRestOperations _edgeOrderOrdersRestClient; /// Initializes a new instance of the class for mocking. protected EdgeOrderCollection() @@ -37,9 +37,9 @@ protected EdgeOrderCollection() /// The identifier of the parent resource that is the target of operations. internal EdgeOrderCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _edgeOrderClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", EdgeOrderResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(EdgeOrderResource.ResourceType, out string edgeOrderApiVersion); - _edgeOrderRestClient = new EdgeOrderManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, edgeOrderApiVersion); + _edgeOrderOrdersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", EdgeOrderResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EdgeOrderResource.ResourceType, out string edgeOrderOrdersApiVersion); + _edgeOrderOrdersRestClient = new OrdersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, edgeOrderOrdersApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -52,7 +52,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Gets an order. + /// Get an order. /// /// /// Request Path @@ -60,7 +60,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// GetOrderByName + /// Orders_Get /// /// /// @@ -73,11 +73,11 @@ public virtual async Task> GetAsync(AzureLocation lo { Argument.AssertNotNullOrEmpty(orderName, nameof(orderName)); - using var scope = _edgeOrderClientDiagnostics.CreateScope("EdgeOrderCollection.Get"); + using var scope = _edgeOrderOrdersClientDiagnostics.CreateScope("EdgeOrderCollection.Get"); scope.Start(); try { - var response = await _edgeOrderRestClient.GetOrderByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, location, orderName, cancellationToken).ConfigureAwait(false); + var response = await _edgeOrderOrdersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, location, orderName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new EdgeOrderResource(Client, response.Value), response.GetRawResponse()); @@ -90,7 +90,7 @@ public virtual async Task> GetAsync(AzureLocation lo } /// - /// Gets an order. + /// Get an order. /// /// /// Request Path @@ -98,7 +98,7 @@ public virtual async Task> GetAsync(AzureLocation lo /// /// /// Operation Id - /// GetOrderByName + /// Orders_Get /// /// /// @@ -111,11 +111,11 @@ public virtual Response Get(AzureLocation location, string or { Argument.AssertNotNullOrEmpty(orderName, nameof(orderName)); - using var scope = _edgeOrderClientDiagnostics.CreateScope("EdgeOrderCollection.Get"); + using var scope = _edgeOrderOrdersClientDiagnostics.CreateScope("EdgeOrderCollection.Get"); scope.Start(); try { - var response = _edgeOrderRestClient.GetOrderByName(Id.SubscriptionId, Id.ResourceGroupName, location, orderName, cancellationToken); + var response = _edgeOrderOrdersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, location, orderName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new EdgeOrderResource(Client, response.Value), response.GetRawResponse()); @@ -136,7 +136,7 @@ public virtual Response Get(AzureLocation location, string or /// /// /// Operation Id - /// GetOrderByName + /// Orders_Get /// /// /// @@ -149,11 +149,11 @@ public virtual async Task> ExistsAsync(AzureLocation location, st { Argument.AssertNotNullOrEmpty(orderName, nameof(orderName)); - using var scope = _edgeOrderClientDiagnostics.CreateScope("EdgeOrderCollection.Exists"); + using var scope = _edgeOrderOrdersClientDiagnostics.CreateScope("EdgeOrderCollection.Exists"); scope.Start(); try { - var response = await _edgeOrderRestClient.GetOrderByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, location, orderName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _edgeOrderOrdersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, location, orderName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -172,7 +172,7 @@ public virtual async Task> ExistsAsync(AzureLocation location, st /// /// /// Operation Id - /// GetOrderByName + /// Orders_Get /// /// /// @@ -185,11 +185,11 @@ public virtual Response Exists(AzureLocation location, string orderName, C { Argument.AssertNotNullOrEmpty(orderName, nameof(orderName)); - using var scope = _edgeOrderClientDiagnostics.CreateScope("EdgeOrderCollection.Exists"); + using var scope = _edgeOrderOrdersClientDiagnostics.CreateScope("EdgeOrderCollection.Exists"); scope.Start(); try { - var response = _edgeOrderRestClient.GetOrderByName(Id.SubscriptionId, Id.ResourceGroupName, location, orderName, cancellationToken: cancellationToken); + var response = _edgeOrderOrdersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, location, orderName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderData.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderData.cs index 9056bb0d2f6d..4ec55c270351 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderData.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderData.cs @@ -33,11 +33,13 @@ public EdgeOrderData() /// List of order item ARM Ids which are part of an order. /// Order current status. /// Order status history. - internal EdgeOrderData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList orderItemIds, EdgeOrderStageDetails currentStage, IReadOnlyList orderStageHistory) : base(id, name, resourceType, systemData) + /// Order mode. + internal EdgeOrderData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IReadOnlyList orderItemIds, EdgeOrderStageDetails currentStage, IReadOnlyList orderStageHistory, OrderMode? orderMode) : base(id, name, resourceType, systemData) { OrderItemIds = orderItemIds; CurrentStage = currentStage; OrderStageHistory = orderStageHistory; + OrderMode = orderMode; } /// List of order item ARM Ids which are part of an order. @@ -46,5 +48,7 @@ internal EdgeOrderData(ResourceIdentifier id, string name, ResourceType resource public EdgeOrderStageDetails CurrentStage { get; } /// Order status history. public IReadOnlyList OrderStageHistory { get; } + /// Order mode. + public OrderMode? OrderMode { get; } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderItemCollection.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderItemCollection.cs index 6cb69cdd70a8..987afa852a90 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderItemCollection.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderItemCollection.cs @@ -26,8 +26,8 @@ namespace Azure.ResourceManager.EdgeOrder /// public partial class EdgeOrderItemCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _edgeOrderItemClientDiagnostics; - private readonly EdgeOrderManagementRestOperations _edgeOrderItemRestClient; + private readonly ClientDiagnostics _edgeOrderItemOrderItemsClientDiagnostics; + private readonly OrderItemsRestOperations _edgeOrderItemOrderItemsRestClient; /// Initializes a new instance of the class for mocking. protected EdgeOrderItemCollection() @@ -39,9 +39,9 @@ protected EdgeOrderItemCollection() /// The identifier of the parent resource that is the target of operations. internal EdgeOrderItemCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _edgeOrderItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", EdgeOrderItemResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(EdgeOrderItemResource.ResourceType, out string edgeOrderItemApiVersion); - _edgeOrderItemRestClient = new EdgeOrderManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, edgeOrderItemApiVersion); + _edgeOrderItemOrderItemsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", EdgeOrderItemResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EdgeOrderItemResource.ResourceType, out string edgeOrderItemOrderItemsApiVersion); + _edgeOrderItemOrderItemsRestClient = new OrderItemsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, edgeOrderItemOrderItemsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -54,7 +54,8 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item API. + /// Create an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item + /// API. /// /// /// Request Path @@ -62,7 +63,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// CreateOrderItem + /// OrderItems_Create /// /// /// @@ -77,12 +78,12 @@ public virtual async Task> CreateOrUpdateAsy Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemCollection.CreateOrUpdate"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemCollection.CreateOrUpdate"); scope.Start(); try { - var response = await _edgeOrderItemRestClient.CreateOrderItemAsync(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, data, cancellationToken).ConfigureAwait(false); - var operation = new EdgeOrderArmOperation(new EdgeOrderItemOperationSource(Client), _edgeOrderItemClientDiagnostics, Pipeline, _edgeOrderItemRestClient.CreateCreateOrderItemRequest(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, data).Request, response, OperationFinalStateVia.Location); + var response = await _edgeOrderItemOrderItemsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, data, cancellationToken).ConfigureAwait(false); + var operation = new EdgeOrderArmOperation(new EdgeOrderItemOperationSource(Client), _edgeOrderItemOrderItemsClientDiagnostics, Pipeline, _edgeOrderItemOrderItemsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -95,7 +96,8 @@ public virtual async Task> CreateOrUpdateAsy } /// - /// Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item API. + /// Create an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item + /// API. /// /// /// Request Path @@ -103,7 +105,7 @@ public virtual async Task> CreateOrUpdateAsy /// /// /// Operation Id - /// CreateOrderItem + /// OrderItems_Create /// /// /// @@ -118,12 +120,12 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); Argument.AssertNotNull(data, nameof(data)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemCollection.CreateOrUpdate"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemCollection.CreateOrUpdate"); scope.Start(); try { - var response = _edgeOrderItemRestClient.CreateOrderItem(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, data, cancellationToken); - var operation = new EdgeOrderArmOperation(new EdgeOrderItemOperationSource(Client), _edgeOrderItemClientDiagnostics, Pipeline, _edgeOrderItemRestClient.CreateCreateOrderItemRequest(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, data).Request, response, OperationFinalStateVia.Location); + var response = _edgeOrderItemOrderItemsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, data, cancellationToken); + var operation = new EdgeOrderArmOperation(new EdgeOrderItemOperationSource(Client), _edgeOrderItemOrderItemsClientDiagnostics, Pipeline, _edgeOrderItemOrderItemsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -136,7 +138,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait } /// - /// Gets an order item. + /// Get an order item. /// /// /// Request Path @@ -144,12 +146,12 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wait /// /// /// Operation Id - /// GetOrderItemByName + /// OrderItems_Get /// /// /// /// The name of the order item. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -157,11 +159,11 @@ public virtual async Task> GetAsync(string order { Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemCollection.Get"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemCollection.Get"); scope.Start(); try { - var response = await _edgeOrderItemRestClient.GetOrderItemByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, expand, cancellationToken).ConfigureAwait(false); + var response = await _edgeOrderItemOrderItemsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, expand, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new EdgeOrderItemResource(Client, response.Value), response.GetRawResponse()); @@ -174,7 +176,7 @@ public virtual async Task> GetAsync(string order } /// - /// Gets an order item. + /// Get an order item. /// /// /// Request Path @@ -182,12 +184,12 @@ public virtual async Task> GetAsync(string order /// /// /// Operation Id - /// GetOrderItemByName + /// OrderItems_Get /// /// /// /// The name of the order item. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -195,11 +197,11 @@ public virtual Response Get(string orderItemName, string { Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemCollection.Get"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemCollection.Get"); scope.Start(); try { - var response = _edgeOrderItemRestClient.GetOrderItemByName(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, expand, cancellationToken); + var response = _edgeOrderItemOrderItemsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, expand, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new EdgeOrderItemResource(Client, response.Value), response.GetRawResponse()); @@ -212,7 +214,7 @@ public virtual Response Get(string orderItemName, string } /// - /// Lists order item at resource group level. + /// List order items at resource group level. /// /// /// Request Path @@ -220,24 +222,25 @@ public virtual Response Get(string orderItemName, string /// /// /// Operation Id - /// ListOrderItemsAtResourceGroupLevel + /// OrderItems_ListByResourceGroup /// /// /// /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetAllAsync(string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _edgeOrderItemRestClient.CreateListOrderItemsAtResourceGroupLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, filter, expand, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _edgeOrderItemRestClient.CreateListOrderItemsAtResourceGroupLevelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, filter, expand, skipToken); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderItemResource(Client, EdgeOrderItemData.DeserializeEdgeOrderItemData(e)), _edgeOrderItemClientDiagnostics, Pipeline, "EdgeOrderItemCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _edgeOrderItemOrderItemsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, filter, expand, skipToken, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _edgeOrderItemOrderItemsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, filter, expand, skipToken, top); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderItemResource(Client, EdgeOrderItemData.DeserializeEdgeOrderItemData(e)), _edgeOrderItemOrderItemsClientDiagnostics, Pipeline, "EdgeOrderItemCollection.GetAll", "value", "nextLink", cancellationToken); } /// - /// Lists order item at resource group level. + /// List order items at resource group level. /// /// /// Request Path @@ -245,20 +248,21 @@ public virtual AsyncPageable GetAllAsync(string filter = /// /// /// Operation Id - /// ListOrderItemsAtResourceGroupLevel + /// OrderItems_ListByResourceGroup /// /// /// /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + public virtual Pageable GetAll(string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _edgeOrderItemRestClient.CreateListOrderItemsAtResourceGroupLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, filter, expand, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _edgeOrderItemRestClient.CreateListOrderItemsAtResourceGroupLevelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, filter, expand, skipToken); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderItemResource(Client, EdgeOrderItemData.DeserializeEdgeOrderItemData(e)), _edgeOrderItemClientDiagnostics, Pipeline, "EdgeOrderItemCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _edgeOrderItemOrderItemsRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, filter, expand, skipToken, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _edgeOrderItemOrderItemsRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, filter, expand, skipToken, top); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderItemResource(Client, EdgeOrderItemData.DeserializeEdgeOrderItemData(e)), _edgeOrderItemOrderItemsClientDiagnostics, Pipeline, "EdgeOrderItemCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -270,12 +274,12 @@ public virtual Pageable GetAll(string filter = null, stri /// /// /// Operation Id - /// GetOrderItemByName + /// OrderItems_Get /// /// /// /// The name of the order item. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -283,11 +287,11 @@ public virtual async Task> ExistsAsync(string orderItemName, stri { Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemCollection.Exists"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemCollection.Exists"); scope.Start(); try { - var response = await _edgeOrderItemRestClient.GetOrderItemByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, expand, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _edgeOrderItemOrderItemsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, expand, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -306,12 +310,12 @@ public virtual async Task> ExistsAsync(string orderItemName, stri /// /// /// Operation Id - /// GetOrderItemByName + /// OrderItems_Get /// /// /// /// The name of the order item. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. @@ -319,11 +323,11 @@ public virtual Response Exists(string orderItemName, string expand = null, { Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemCollection.Exists"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemCollection.Exists"); scope.Start(); try { - var response = _edgeOrderItemRestClient.GetOrderItemByName(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, expand, cancellationToken: cancellationToken); + var response = _edgeOrderItemOrderItemsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, orderItemName, expand, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderItemData.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderItemData.cs index caa1f64e05f3..ef074f3de900 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderItemData.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderItemData.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.EdgeOrder { /// /// A class representing the EdgeOrderItem data model. - /// Represents order item contract + /// Represents order item resource. /// public partial class EdgeOrderItemData : TrackedResourceData { diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderItemResource.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderItemResource.cs index ce0679372841..1d2e3ddf3f9f 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderItemResource.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderItemResource.cs @@ -34,8 +34,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _edgeOrderItemClientDiagnostics; - private readonly EdgeOrderManagementRestOperations _edgeOrderItemRestClient; + private readonly ClientDiagnostics _edgeOrderItemOrderItemsClientDiagnostics; + private readonly OrderItemsRestOperations _edgeOrderItemOrderItemsRestClient; private readonly EdgeOrderItemData _data; /// Initializes a new instance of the class for mocking. @@ -57,9 +57,9 @@ internal EdgeOrderItemResource(ArmClient client, EdgeOrderItemData data) : this( /// The identifier of the resource that is the target of operations. internal EdgeOrderItemResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _edgeOrderItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string edgeOrderItemApiVersion); - _edgeOrderItemRestClient = new EdgeOrderManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, edgeOrderItemApiVersion); + _edgeOrderItemOrderItemsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string edgeOrderItemOrderItemsApiVersion); + _edgeOrderItemOrderItemsRestClient = new OrderItemsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, edgeOrderItemOrderItemsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -90,7 +90,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Gets an order item. + /// Get an order item. /// /// /// Request Path @@ -98,19 +98,19 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// GetOrderItemByName + /// OrderItems_Get /// /// /// - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. /// The cancellation token to use. public virtual async Task> GetAsync(string expand = null, CancellationToken cancellationToken = default) { - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.Get"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.Get"); scope.Start(); try { - var response = await _edgeOrderItemRestClient.GetOrderItemByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand, cancellationToken).ConfigureAwait(false); + var response = await _edgeOrderItemOrderItemsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new EdgeOrderItemResource(Client, response.Value), response.GetRawResponse()); @@ -123,7 +123,7 @@ public virtual async Task> GetAsync(string expan } /// - /// Gets an order item. + /// Get an order item. /// /// /// Request Path @@ -131,19 +131,19 @@ public virtual async Task> GetAsync(string expan /// /// /// Operation Id - /// GetOrderItemByName + /// OrderItems_Get /// /// /// - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. /// The cancellation token to use. public virtual Response Get(string expand = null, CancellationToken cancellationToken = default) { - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.Get"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.Get"); scope.Start(); try { - var response = _edgeOrderItemRestClient.GetOrderItemByName(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand, cancellationToken); + var response = _edgeOrderItemOrderItemsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new EdgeOrderItemResource(Client, response.Value), response.GetRawResponse()); @@ -156,7 +156,7 @@ public virtual Response Get(string expand = null, Cancell } /// - /// Deletes an order item. + /// Delete an order item. /// /// /// Request Path @@ -164,7 +164,7 @@ public virtual Response Get(string expand = null, Cancell /// /// /// Operation Id - /// DeleteOrderItemByName + /// OrderItems_Delete /// /// /// @@ -172,12 +172,12 @@ public virtual Response Get(string expand = null, Cancell /// The cancellation token to use. public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.Delete"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.Delete"); scope.Start(); try { - var response = await _edgeOrderItemRestClient.DeleteOrderItemByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new EdgeOrderArmOperation(_edgeOrderItemClientDiagnostics, Pipeline, _edgeOrderItemRestClient.CreateDeleteOrderItemByNameRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _edgeOrderItemOrderItemsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new EdgeOrderArmOperation(_edgeOrderItemOrderItemsClientDiagnostics, Pipeline, _edgeOrderItemOrderItemsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -190,7 +190,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell } /// - /// Deletes an order item. + /// Delete an order item. /// /// /// Request Path @@ -198,7 +198,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// DeleteOrderItemByName + /// OrderItems_Delete /// /// /// @@ -206,12 +206,12 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// The cancellation token to use. public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.Delete"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.Delete"); scope.Start(); try { - var response = _edgeOrderItemRestClient.DeleteOrderItemByName(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); - var operation = new EdgeOrderArmOperation(_edgeOrderItemClientDiagnostics, Pipeline, _edgeOrderItemRestClient.CreateDeleteOrderItemByNameRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _edgeOrderItemOrderItemsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new EdgeOrderArmOperation(_edgeOrderItemOrderItemsClientDiagnostics, Pipeline, _edgeOrderItemOrderItemsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -224,7 +224,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel } /// - /// Updates the properties of an existing order item. + /// Update the properties of an existing order item. /// /// /// Request Path @@ -232,12 +232,12 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// UpdateOrderItem + /// OrderItems_Update /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// order item update parameters from request body. + /// Order item update parameters from request body. /// Defines the If-Match condition. The patch will be performed only if the ETag of the order on the server matches this value. /// The cancellation token to use. /// is null. @@ -245,12 +245,12 @@ public virtual async Task> UpdateAsync(WaitU { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.Update"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.Update"); scope.Start(); try { - var response = await _edgeOrderItemRestClient.UpdateOrderItemAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); - var operation = new EdgeOrderArmOperation(new EdgeOrderItemOperationSource(Client), _edgeOrderItemClientDiagnostics, Pipeline, _edgeOrderItemRestClient.CreateUpdateOrderItemRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + var response = await _edgeOrderItemOrderItemsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken).ConfigureAwait(false); + var operation = new EdgeOrderArmOperation(new EdgeOrderItemOperationSource(Client), _edgeOrderItemOrderItemsClientDiagnostics, Pipeline, _edgeOrderItemOrderItemsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -263,7 +263,7 @@ public virtual async Task> UpdateAsync(WaitU } /// - /// Updates the properties of an existing order item. + /// Update the properties of an existing order item. /// /// /// Request Path @@ -271,12 +271,12 @@ public virtual async Task> UpdateAsync(WaitU /// /// /// Operation Id - /// UpdateOrderItem + /// OrderItems_Update /// /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// order item update parameters from request body. + /// Order item update parameters from request body. /// Defines the If-Match condition. The patch will be performed only if the ETag of the order on the server matches this value. /// The cancellation token to use. /// is null. @@ -284,12 +284,12 @@ public virtual ArmOperation Update(WaitUntil waitUntil, E { Argument.AssertNotNull(patch, nameof(patch)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.Update"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.Update"); scope.Start(); try { - var response = _edgeOrderItemRestClient.UpdateOrderItem(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken); - var operation = new EdgeOrderArmOperation(new EdgeOrderItemOperationSource(Client), _edgeOrderItemClientDiagnostics, Pipeline, _edgeOrderItemRestClient.CreateUpdateOrderItemRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); + var response = _edgeOrderItemOrderItemsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch, cancellationToken); + var operation = new EdgeOrderArmOperation(new EdgeOrderItemOperationSource(Client), _edgeOrderItemOrderItemsClientDiagnostics, Pipeline, _edgeOrderItemOrderItemsRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, ifMatch).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; @@ -310,7 +310,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, E /// /// /// Operation Id - /// CancelOrderItem + /// OrderItems_Cancel /// /// /// @@ -321,11 +321,11 @@ public virtual async Task CancelAsync(EdgeOrderItemCancellationReason { Argument.AssertNotNull(cancellationReason, nameof(cancellationReason)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.Cancel"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.Cancel"); scope.Start(); try { - var response = await _edgeOrderItemRestClient.CancelOrderItemAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationReason, cancellationToken).ConfigureAwait(false); + var response = await _edgeOrderItemOrderItemsRestClient.CancelAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationReason, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -344,7 +344,7 @@ public virtual async Task CancelAsync(EdgeOrderItemCancellationReason /// /// /// Operation Id - /// CancelOrderItem + /// OrderItems_Cancel /// /// /// @@ -355,11 +355,11 @@ public virtual Response Cancel(EdgeOrderItemCancellationReason cancellationReaso { Argument.AssertNotNull(cancellationReason, nameof(cancellationReason)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.Cancel"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.Cancel"); scope.Start(); try { - var response = _edgeOrderItemRestClient.CancelOrderItem(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationReason, cancellationToken); + var response = _edgeOrderItemOrderItemsRestClient.Cancel(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationReason, cancellationToken); return response; } catch (Exception e) @@ -378,24 +378,24 @@ public virtual Response Cancel(EdgeOrderItemCancellationReason cancellationReaso /// /// /// Operation Id - /// ReturnOrderItem + /// OrderItems_Return /// /// /// /// 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. - /// Return order item CurrentStatus. + /// Return order item details. /// The cancellation token to use. /// is null. public virtual async Task ReturnAsync(WaitUntil waitUntil, EdgeOrderItemReturnContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.Return"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.Return"); scope.Start(); try { - var response = await _edgeOrderItemRestClient.ReturnOrderItemAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new EdgeOrderArmOperation(_edgeOrderItemClientDiagnostics, Pipeline, _edgeOrderItemRestClient.CreateReturnOrderItemRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _edgeOrderItemOrderItemsRestClient.ReturnAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new EdgeOrderArmOperation(_edgeOrderItemOrderItemsClientDiagnostics, Pipeline, _edgeOrderItemOrderItemsRestClient.CreateReturnRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -416,24 +416,24 @@ public virtual async Task ReturnAsync(WaitUntil waitUntil, EdgeOrd /// /// /// Operation Id - /// ReturnOrderItem + /// OrderItems_Return /// /// /// /// 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. - /// Return order item CurrentStatus. + /// Return order item details. /// The cancellation token to use. /// is null. public virtual ArmOperation Return(WaitUntil waitUntil, EdgeOrderItemReturnContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.Return"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.Return"); scope.Start(); try { - var response = _edgeOrderItemRestClient.ReturnOrderItem(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); - var operation = new EdgeOrderArmOperation(_edgeOrderItemClientDiagnostics, Pipeline, _edgeOrderItemRestClient.CreateReturnOrderItemRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _edgeOrderItemOrderItemsRestClient.Return(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new EdgeOrderArmOperation(_edgeOrderItemOrderItemsClientDiagnostics, Pipeline, _edgeOrderItemOrderItemsRestClient.CreateReturnRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -454,7 +454,7 @@ public virtual ArmOperation Return(WaitUntil waitUntil, EdgeOrderItemReturnConte /// /// /// Operation Id - /// GetOrderItemByName + /// OrderItems_Get /// /// /// @@ -467,7 +467,7 @@ public virtual async Task> AddTagAsync(string ke Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.AddTag"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.AddTag"); scope.Start(); try { @@ -476,7 +476,7 @@ public virtual async Task> AddTagAsync(string ke var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues[key] = value; await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _edgeOrderItemRestClient.GetOrderItemByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, null, cancellationToken).ConfigureAwait(false); + var originalResponse = await _edgeOrderItemOrderItemsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, null, cancellationToken).ConfigureAwait(false); return Response.FromValue(new EdgeOrderItemResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -508,7 +508,7 @@ public virtual async Task> AddTagAsync(string ke /// /// /// Operation Id - /// GetOrderItemByName + /// OrderItems_Get /// /// /// @@ -521,7 +521,7 @@ public virtual Response AddTag(string key, string value, Argument.AssertNotNull(key, nameof(key)); Argument.AssertNotNull(value, nameof(value)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.AddTag"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.AddTag"); scope.Start(); try { @@ -530,7 +530,7 @@ public virtual Response AddTag(string key, string value, var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues[key] = value; GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _edgeOrderItemRestClient.GetOrderItemByName(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, null, cancellationToken); + var originalResponse = _edgeOrderItemOrderItemsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, null, cancellationToken); return Response.FromValue(new EdgeOrderItemResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -562,7 +562,7 @@ public virtual Response AddTag(string key, string value, /// /// /// Operation Id - /// GetOrderItemByName + /// OrderItems_Get /// /// /// @@ -573,7 +573,7 @@ public virtual async Task> SetTagsAsync(IDiction { Argument.AssertNotNull(tags, nameof(tags)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.SetTags"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.SetTags"); scope.Start(); try { @@ -583,7 +583,7 @@ public virtual async Task> SetTagsAsync(IDiction var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.ReplaceWith(tags); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _edgeOrderItemRestClient.GetOrderItemByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, null, cancellationToken).ConfigureAwait(false); + var originalResponse = await _edgeOrderItemOrderItemsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, null, cancellationToken).ConfigureAwait(false); return Response.FromValue(new EdgeOrderItemResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -611,7 +611,7 @@ public virtual async Task> SetTagsAsync(IDiction /// /// /// Operation Id - /// GetOrderItemByName + /// OrderItems_Get /// /// /// @@ -622,7 +622,7 @@ public virtual Response SetTags(IDictionary SetTags(IDictionary SetTags(IDictionary /// /// Operation Id - /// GetOrderItemByName + /// OrderItems_Get /// /// /// @@ -671,7 +671,7 @@ public virtual async Task> RemoveTagAsync(string { Argument.AssertNotNull(key, nameof(key)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.RemoveTag"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.RemoveTag"); scope.Start(); try { @@ -680,7 +680,7 @@ public virtual async Task> RemoveTagAsync(string var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); originalTags.Value.Data.TagValues.Remove(key); await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); - var originalResponse = await _edgeOrderItemRestClient.GetOrderItemByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, null, cancellationToken).ConfigureAwait(false); + var originalResponse = await _edgeOrderItemOrderItemsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, null, cancellationToken).ConfigureAwait(false); return Response.FromValue(new EdgeOrderItemResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else @@ -712,7 +712,7 @@ public virtual async Task> RemoveTagAsync(string /// /// /// Operation Id - /// GetOrderItemByName + /// OrderItems_Get /// /// /// @@ -723,7 +723,7 @@ public virtual Response RemoveTag(string key, Cancellatio { Argument.AssertNotNull(key, nameof(key)); - using var scope = _edgeOrderItemClientDiagnostics.CreateScope("EdgeOrderItemResource.RemoveTag"); + using var scope = _edgeOrderItemOrderItemsClientDiagnostics.CreateScope("EdgeOrderItemResource.RemoveTag"); scope.Start(); try { @@ -732,7 +732,7 @@ public virtual Response RemoveTag(string key, Cancellatio var originalTags = GetTagResource().Get(cancellationToken); originalTags.Value.Data.TagValues.Remove(key); GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); - var originalResponse = _edgeOrderItemRestClient.GetOrderItemByName(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, null, cancellationToken); + var originalResponse = _edgeOrderItemOrderItemsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, null, cancellationToken); return Response.FromValue(new EdgeOrderItemResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); } else diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderResource.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderResource.cs index 2c192697a6f7..c42b458f3614 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderResource.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/EdgeOrderResource.cs @@ -32,8 +32,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _edgeOrderClientDiagnostics; - private readonly EdgeOrderManagementRestOperations _edgeOrderRestClient; + private readonly ClientDiagnostics _edgeOrderOrdersClientDiagnostics; + private readonly OrdersRestOperations _edgeOrderOrdersRestClient; private readonly EdgeOrderData _data; /// Initializes a new instance of the class for mocking. @@ -55,9 +55,9 @@ internal EdgeOrderResource(ArmClient client, EdgeOrderData data) : this(client, /// The identifier of the resource that is the target of operations. internal EdgeOrderResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _edgeOrderClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string edgeOrderApiVersion); - _edgeOrderRestClient = new EdgeOrderManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, edgeOrderApiVersion); + _edgeOrderOrdersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string edgeOrderOrdersApiVersion); + _edgeOrderOrdersRestClient = new OrdersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, edgeOrderOrdersApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -88,7 +88,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) } /// - /// Gets an order. + /// Get an order. /// /// /// Request Path @@ -96,18 +96,18 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// GetOrderByName + /// Orders_Get /// /// /// /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _edgeOrderClientDiagnostics.CreateScope("EdgeOrderResource.Get"); + using var scope = _edgeOrderOrdersClientDiagnostics.CreateScope("EdgeOrderResource.Get"); scope.Start(); try { - var response = await _edgeOrderRestClient.GetOrderByNameAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _edgeOrderOrdersRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new EdgeOrderResource(Client, response.Value), response.GetRawResponse()); @@ -120,7 +120,7 @@ public virtual async Task> GetAsync(CancellationToke } /// - /// Gets an order. + /// Get an order. /// /// /// Request Path @@ -128,18 +128,18 @@ public virtual async Task> GetAsync(CancellationToke /// /// /// Operation Id - /// GetOrderByName + /// Orders_Get /// /// /// /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _edgeOrderClientDiagnostics.CreateScope("EdgeOrderResource.Get"); + using var scope = _edgeOrderOrdersClientDiagnostics.CreateScope("EdgeOrderResource.Get"); scope.Start(); try { - var response = _edgeOrderRestClient.GetOrderByName(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); + var response = _edgeOrderOrdersRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new EdgeOrderResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderExtensions.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderExtensions.cs index fe6feccc6eca..d599707960d4 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderExtensions.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/EdgeOrderExtensions.cs @@ -29,7 +29,7 @@ private static SubscriptionResourceExtensionClient GetExtensionClient(Subscripti } /// - /// Lists all the addresses available under the subscription. + /// List all the addresses available under the subscription. /// /// /// Request Path @@ -37,22 +37,23 @@ private static SubscriptionResourceExtensionClient GetExtensionClient(Subscripti /// /// /// Operation Id - /// ListAddressesAtSubscriptionLevel + /// Addresses_ListBySubscription /// /// /// /// The instance the method will execute against. /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetEdgeOrderAddressesAsync(this SubscriptionResource subscriptionResource, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + public static AsyncPageable GetEdgeOrderAddressesAsync(this SubscriptionResource subscriptionResource, string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetEdgeOrderAddressesAsync(filter, skipToken, cancellationToken); + return GetExtensionClient(subscriptionResource).GetEdgeOrderAddressesAsync(filter, skipToken, top, cancellationToken); } /// - /// Lists all the addresses available under the subscription. + /// List all the addresses available under the subscription. /// /// /// Request Path @@ -60,128 +61,129 @@ public static AsyncPageable GetEdgeOrderAddressesAsync /// /// /// Operation Id - /// ListAddressesAtSubscriptionLevel + /// Addresses_ListBySubscription /// /// /// /// The instance the method will execute against. /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetEdgeOrderAddresses(this SubscriptionResource subscriptionResource, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + public static Pageable GetEdgeOrderAddresses(this SubscriptionResource subscriptionResource, string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetEdgeOrderAddresses(filter, skipToken, cancellationToken); + return GetExtensionClient(subscriptionResource).GetEdgeOrderAddresses(filter, skipToken, top, cancellationToken); } /// - /// This method provides the list of product families for the given subscription. + /// List configurations for the given product family, product line and product for the given subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations /// /// /// Operation Id - /// ListProductFamilies + /// ProductsAndConfigurations_ListConfigurations /// /// /// /// The instance the method will execute against. - /// Filters for showing the product families. - /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. - /// $skipToken is supported on list of product families, which provides the next page in the list of product families. + /// Filters for showing the configurations. + /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetProductFamiliesAsync(this SubscriptionResource subscriptionResource, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetConfigurationsProductsAndConfigurationsAsync(this SubscriptionResource subscriptionResource, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - return GetExtensionClient(subscriptionResource).GetProductFamiliesAsync(content, expand, skipToken, cancellationToken); + return GetExtensionClient(subscriptionResource).GetConfigurationsProductsAndConfigurationsAsync(content, skipToken, cancellationToken); } /// - /// This method provides the list of product families for the given subscription. + /// List configurations for the given product family, product line and product for the given subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations /// /// /// Operation Id - /// ListProductFamilies + /// ProductsAndConfigurations_ListConfigurations /// /// /// /// The instance the method will execute against. - /// Filters for showing the product families. - /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. - /// $skipToken is supported on list of product families, which provides the next page in the list of product families. + /// Filters for showing the configurations. + /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetProductFamilies(this SubscriptionResource subscriptionResource, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetConfigurationsProductsAndConfigurations(this SubscriptionResource subscriptionResource, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - return GetExtensionClient(subscriptionResource).GetProductFamilies(content, expand, skipToken, cancellationToken); + return GetExtensionClient(subscriptionResource).GetConfigurationsProductsAndConfigurations(content, skipToken, cancellationToken); } /// - /// This method provides the list of configurations for the given product family, product line and product under subscription. + /// List product families for the given subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies /// /// /// Operation Id - /// ListConfigurations + /// ProductsAndConfigurations_ListProductFamilies /// /// /// /// The instance the method will execute against. - /// Filters for showing the configurations. - /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. + /// Filters for showing the product families. + /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. + /// $skipToken is supported on list of product families, which provides the next page in the list of product families. /// The cancellation token to use. /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetConfigurationsAsync(this SubscriptionResource subscriptionResource, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetProductFamiliesProductsAndConfigurationsAsync(this SubscriptionResource subscriptionResource, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - return GetExtensionClient(subscriptionResource).GetConfigurationsAsync(content, skipToken, cancellationToken); + return GetExtensionClient(subscriptionResource).GetProductFamiliesProductsAndConfigurationsAsync(content, expand, skipToken, cancellationToken); } /// - /// This method provides the list of configurations for the given product family, product line and product under subscription. + /// List product families for the given subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies /// /// /// Operation Id - /// ListConfigurations + /// ProductsAndConfigurations_ListProductFamilies /// /// /// /// The instance the method will execute against. - /// Filters for showing the configurations. - /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. + /// Filters for showing the product families. + /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. + /// $skipToken is supported on list of product families, which provides the next page in the list of product families. /// The cancellation token to use. /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetConfigurations(this SubscriptionResource subscriptionResource, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetProductFamiliesProductsAndConfigurations(this SubscriptionResource subscriptionResource, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - return GetExtensionClient(subscriptionResource).GetConfigurations(content, skipToken, cancellationToken); + return GetExtensionClient(subscriptionResource).GetProductFamiliesProductsAndConfigurations(content, expand, skipToken, cancellationToken); } /// - /// This method provides the list of product families metadata for the given subscription. + /// List product families metadata for the given subscription. /// /// /// Request Path @@ -189,7 +191,7 @@ public static Pageable GetConfigurations(this Subscription /// /// /// Operation Id - /// ListProductFamiliesMetadata + /// ProductsAndConfigurations_ListProductFamiliesMetadata /// /// /// @@ -197,13 +199,13 @@ public static Pageable GetConfigurations(this Subscription /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetProductFamiliesMetadataAsync(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) + public static AsyncPageable GetProductFamiliesMetadataProductsAndConfigurationsAsync(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetProductFamiliesMetadataAsync(skipToken, cancellationToken); + return GetExtensionClient(subscriptionResource).GetProductFamiliesMetadataProductsAndConfigurationsAsync(skipToken, cancellationToken); } /// - /// This method provides the list of product families metadata for the given subscription. + /// List product families metadata for the given subscription. /// /// /// Request Path @@ -211,7 +213,7 @@ public static AsyncPageable GetProductFamiliesMetadataA /// /// /// Operation Id - /// ListProductFamiliesMetadata + /// ProductsAndConfigurations_ListProductFamiliesMetadata /// /// /// @@ -219,101 +221,105 @@ public static AsyncPageable GetProductFamiliesMetadataA /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetProductFamiliesMetadata(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) + public static Pageable GetProductFamiliesMetadataProductsAndConfigurations(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetProductFamiliesMetadata(skipToken, cancellationToken); + return GetExtensionClient(subscriptionResource).GetProductFamiliesMetadataProductsAndConfigurations(skipToken, cancellationToken); } /// - /// Lists order at subscription level. + /// List order items at subscription level. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems /// /// /// Operation Id - /// ListOrderAtSubscriptionLevel + /// OrderItems_ListBySubscription /// /// /// /// The instance the method will execute against. - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. + /// $filter is supported to filter based on order id. Filter supports only equals operation. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetEdgeOrdersAsync(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetEdgeOrderItemsAsync(this SubscriptionResource subscriptionResource, string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetEdgeOrdersAsync(skipToken, cancellationToken); + return GetExtensionClient(subscriptionResource).GetEdgeOrderItemsAsync(filter, expand, skipToken, top, cancellationToken); } /// - /// Lists order at subscription level. + /// List order items at subscription level. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems /// /// /// Operation Id - /// ListOrderAtSubscriptionLevel + /// OrderItems_ListBySubscription /// /// /// /// The instance the method will execute against. - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. + /// $filter is supported to filter based on order id. Filter supports only equals operation. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetEdgeOrders(this SubscriptionResource subscriptionResource, string skipToken = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetEdgeOrderItems(this SubscriptionResource subscriptionResource, string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetEdgeOrders(skipToken, cancellationToken); + return GetExtensionClient(subscriptionResource).GetEdgeOrderItems(filter, expand, skipToken, top, cancellationToken); } /// - /// Lists order item at subscription level. + /// List orders at subscription level. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders /// /// /// Operation Id - /// ListOrderItemsAtSubscriptionLevel + /// Orders_ListBySubscription /// /// /// /// The instance the method will execute against. - /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetEdgeOrderItemsAsync(this SubscriptionResource subscriptionResource, string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetEdgeOrdersAsync(this SubscriptionResource subscriptionResource, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetEdgeOrderItemsAsync(filter, expand, skipToken, cancellationToken); + return GetExtensionClient(subscriptionResource).GetEdgeOrdersAsync(skipToken, top, cancellationToken); } /// - /// Lists order item at subscription level. + /// List orders at subscription level. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders /// /// /// Operation Id - /// ListOrderItemsAtSubscriptionLevel + /// Orders_ListBySubscription /// /// /// /// The instance the method will execute against. - /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetEdgeOrderItems(this SubscriptionResource subscriptionResource, string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetEdgeOrders(this SubscriptionResource subscriptionResource, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - return GetExtensionClient(subscriptionResource).GetEdgeOrderItems(filter, expand, skipToken, cancellationToken); + return GetExtensionClient(subscriptionResource).GetEdgeOrders(skipToken, top, cancellationToken); } private static ResourceGroupResourceExtensionClient GetExtensionClient(ResourceGroupResource resourceGroupResource) @@ -334,7 +340,7 @@ public static EdgeOrderAddressCollection GetEdgeOrderAddresses(this ResourceGrou } /// - /// Gets information about the specified address. + /// Get information about the specified address. /// /// /// Request Path @@ -342,7 +348,7 @@ public static EdgeOrderAddressCollection GetEdgeOrderAddresses(this ResourceGrou /// /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// @@ -358,7 +364,7 @@ public static async Task> GetEdgeOrderAddress } /// - /// Gets information about the specified address. + /// Get information about the specified address. /// /// /// Request Path @@ -366,7 +372,7 @@ public static async Task> GetEdgeOrderAddress /// /// /// Operation Id - /// GetAddressByName + /// Addresses_Get /// /// /// @@ -381,124 +387,124 @@ public static Response GetEdgeOrderAddress(this Resour return resourceGroupResource.GetEdgeOrderAddresses().Get(addressName, cancellationToken); } - /// Gets a collection of EdgeOrderResources in the ResourceGroupResource. + /// Gets a collection of EdgeOrderItemResources in the ResourceGroupResource. /// The instance the method will execute against. - /// An object representing collection of EdgeOrderResources and their operations over a EdgeOrderResource. - public static EdgeOrderCollection GetEdgeOrders(this ResourceGroupResource resourceGroupResource) + /// An object representing collection of EdgeOrderItemResources and their operations over a EdgeOrderItemResource. + public static EdgeOrderItemCollection GetEdgeOrderItems(this ResourceGroupResource resourceGroupResource) { - return GetExtensionClient(resourceGroupResource).GetEdgeOrders(); + return GetExtensionClient(resourceGroupResource).GetEdgeOrderItems(); } /// - /// Gets an order. + /// Get an order item. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName} /// /// /// Operation Id - /// GetOrderByName + /// OrderItems_Get /// /// /// /// The instance the method will execute against. - /// The name of Azure region. - /// The name of the order. + /// The name of the order item. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. + /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] - public static async Task> GetEdgeOrderAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, string orderName, CancellationToken cancellationToken = default) + public static async Task> GetEdgeOrderItemAsync(this ResourceGroupResource resourceGroupResource, string orderItemName, string expand = null, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetEdgeOrders().GetAsync(location, orderName, cancellationToken).ConfigureAwait(false); + return await resourceGroupResource.GetEdgeOrderItems().GetAsync(orderItemName, expand, cancellationToken).ConfigureAwait(false); } /// - /// Gets an order. + /// Get an order item. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName} /// /// /// Operation Id - /// GetOrderByName + /// OrderItems_Get /// /// /// /// The instance the method will execute against. - /// The name of Azure region. - /// The name of the order. + /// The name of the order item. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. + /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] - public static Response GetEdgeOrder(this ResourceGroupResource resourceGroupResource, AzureLocation location, string orderName, CancellationToken cancellationToken = default) + public static Response GetEdgeOrderItem(this ResourceGroupResource resourceGroupResource, string orderItemName, string expand = null, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetEdgeOrders().Get(location, orderName, cancellationToken); + return resourceGroupResource.GetEdgeOrderItems().Get(orderItemName, expand, cancellationToken); } - /// Gets a collection of EdgeOrderItemResources in the ResourceGroupResource. + /// Gets a collection of EdgeOrderResources in the ResourceGroupResource. /// The instance the method will execute against. - /// An object representing collection of EdgeOrderItemResources and their operations over a EdgeOrderItemResource. - public static EdgeOrderItemCollection GetEdgeOrderItems(this ResourceGroupResource resourceGroupResource) + /// An object representing collection of EdgeOrderResources and their operations over a EdgeOrderResource. + public static EdgeOrderCollection GetEdgeOrders(this ResourceGroupResource resourceGroupResource) { - return GetExtensionClient(resourceGroupResource).GetEdgeOrderItems(); + return GetExtensionClient(resourceGroupResource).GetEdgeOrders(); } /// - /// Gets an order item. + /// Get an order. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName} /// /// /// Operation Id - /// GetOrderItemByName + /// Orders_Get /// /// /// /// The instance the method will execute against. - /// The name of the order item. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// The name of Azure region. + /// The name of the order. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. + /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] - public static async Task> GetEdgeOrderItemAsync(this ResourceGroupResource resourceGroupResource, string orderItemName, string expand = null, CancellationToken cancellationToken = default) + public static async Task> GetEdgeOrderAsync(this ResourceGroupResource resourceGroupResource, AzureLocation location, string orderName, CancellationToken cancellationToken = default) { - return await resourceGroupResource.GetEdgeOrderItems().GetAsync(orderItemName, expand, cancellationToken).ConfigureAwait(false); + return await resourceGroupResource.GetEdgeOrders().GetAsync(location, orderName, cancellationToken).ConfigureAwait(false); } /// - /// Gets an order item. + /// Get an order. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems/{orderItemName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/locations/{location}/orders/{orderName} /// /// /// Operation Id - /// GetOrderItemByName + /// Orders_Get /// /// /// /// The instance the method will execute against. - /// The name of the order item. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// The name of Azure region. + /// The name of the order. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. + /// is an empty string, and was expected to be non-empty. + /// is null. [ForwardsClientCalls] - public static Response GetEdgeOrderItem(this ResourceGroupResource resourceGroupResource, string orderItemName, string expand = null, CancellationToken cancellationToken = default) + public static Response GetEdgeOrder(this ResourceGroupResource resourceGroupResource, AzureLocation location, string orderName, CancellationToken cancellationToken = default) { - return resourceGroupResource.GetEdgeOrderItems().Get(orderItemName, expand, cancellationToken); + return resourceGroupResource.GetEdgeOrders().Get(location, orderName, cancellationToken); } /// - /// Lists order at resource group level. + /// List orders at resource group level. /// /// /// Request Path @@ -506,21 +512,22 @@ public static Response GetEdgeOrderItem(this ResourceGrou /// /// /// Operation Id - /// ListOrderAtResourceGroupLevel + /// Orders_ListByResourceGroup /// /// /// /// The instance the method will execute against. - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetEdgeOrdersAsync(this ResourceGroupResource resourceGroupResource, string skipToken = null, CancellationToken cancellationToken = default) + public static AsyncPageable GetEdgeOrdersAsync(this ResourceGroupResource resourceGroupResource, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - return GetExtensionClient(resourceGroupResource).GetEdgeOrdersAsync(skipToken, cancellationToken); + return GetExtensionClient(resourceGroupResource).GetEdgeOrdersAsync(skipToken, top, cancellationToken); } /// - /// Lists order at resource group level. + /// List orders at resource group level. /// /// /// Request Path @@ -528,17 +535,18 @@ public static AsyncPageable GetEdgeOrdersAsync(this ResourceG /// /// /// Operation Id - /// ListOrderAtResourceGroupLevel + /// Orders_ListByResourceGroup /// /// /// /// The instance the method will execute against. - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetEdgeOrders(this ResourceGroupResource resourceGroupResource, string skipToken = null, CancellationToken cancellationToken = default) + public static Pageable GetEdgeOrders(this ResourceGroupResource resourceGroupResource, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - return GetExtensionClient(resourceGroupResource).GetEdgeOrders(skipToken, cancellationToken); + return GetExtensionClient(resourceGroupResource).GetEdgeOrders(skipToken, top, cancellationToken); } #region EdgeOrderAddressResource @@ -560,39 +568,39 @@ public static EdgeOrderAddressResource GetEdgeOrderAddressResource(this ArmClien } #endregion - #region EdgeOrderResource + #region EdgeOrderItemResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static EdgeOrderResource GetEdgeOrderResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static EdgeOrderItemResource GetEdgeOrderItemResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - EdgeOrderResource.ValidateResourceId(id); - return new EdgeOrderResource(client, id); + EdgeOrderItemResource.ValidateResourceId(id); + return new EdgeOrderItemResource(client, id); } ); } #endregion - #region EdgeOrderItemResource + #region EdgeOrderResource /// - /// Gets an object representing an along with the instance operations that can be performed on it but with no data. - /// You can use to create an from its components. + /// Gets an object representing an along with the instance operations that can be performed on it but with no data. + /// You can use to create an from its components. /// /// The instance the method will execute against. /// The resource ID of the resource to get. - /// Returns a object. - public static EdgeOrderItemResource GetEdgeOrderItemResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static EdgeOrderResource GetEdgeOrderResource(this ArmClient client, ResourceIdentifier id) { return client.GetResourceClient(() => { - EdgeOrderItemResource.ValidateResourceId(id); - return new EdgeOrderItemResource(client, id); + EdgeOrderResource.ValidateResourceId(id); + return new EdgeOrderResource(client, id); } ); } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs index f3609ae64c0f..28de84035cc9 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs @@ -16,8 +16,8 @@ namespace Azure.ResourceManager.EdgeOrder /// A class to add extension methods to ResourceGroupResource. internal partial class ResourceGroupResourceExtensionClient : ArmResource { - private ClientDiagnostics _defaultClientDiagnostics; - private EdgeOrderManagementRestOperations _defaultRestClient; + private ClientDiagnostics _edgeOrderOrdersClientDiagnostics; + private OrdersRestOperations _edgeOrderOrdersRestClient; /// Initializes a new instance of the class for mocking. protected ResourceGroupResourceExtensionClient() @@ -31,8 +31,8 @@ internal ResourceGroupResourceExtensionClient(ArmClient client, ResourceIdentifi { } - private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private EdgeOrderManagementRestOperations DefaultRestClient => _defaultRestClient ??= new EdgeOrderManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics EdgeOrderOrdersClientDiagnostics => _edgeOrderOrdersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", EdgeOrderResource.ResourceType.Namespace, Diagnostics); + private OrdersRestOperations EdgeOrderOrdersRestClient => _edgeOrderOrdersRestClient ??= new OrdersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(EdgeOrderResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -47,13 +47,6 @@ public virtual EdgeOrderAddressCollection GetEdgeOrderAddresses() return GetCachedClient(Client => new EdgeOrderAddressCollection(Client, Id)); } - /// Gets a collection of EdgeOrderResources in the ResourceGroupResource. - /// An object representing collection of EdgeOrderResources and their operations over a EdgeOrderResource. - public virtual EdgeOrderCollection GetEdgeOrders() - { - return GetCachedClient(Client => new EdgeOrderCollection(Client, Id)); - } - /// Gets a collection of EdgeOrderItemResources in the ResourceGroupResource. /// An object representing collection of EdgeOrderItemResources and their operations over a EdgeOrderItemResource. public virtual EdgeOrderItemCollection GetEdgeOrderItems() @@ -61,8 +54,15 @@ public virtual EdgeOrderItemCollection GetEdgeOrderItems() return GetCachedClient(Client => new EdgeOrderItemCollection(Client, Id)); } + /// Gets a collection of EdgeOrderResources in the ResourceGroupResource. + /// An object representing collection of EdgeOrderResources and their operations over a EdgeOrderResource. + public virtual EdgeOrderCollection GetEdgeOrders() + { + return GetCachedClient(Client => new EdgeOrderCollection(Client, Id)); + } + /// - /// Lists order at resource group level. + /// List orders at resource group level. /// /// /// Request Path @@ -70,22 +70,23 @@ public virtual EdgeOrderItemCollection GetEdgeOrderItems() /// /// /// Operation Id - /// ListOrderAtResourceGroupLevel + /// Orders_ListByResourceGroup /// /// /// - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetEdgeOrdersAsync(string skipToken = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetEdgeOrdersAsync(string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListOrderAtResourceGroupLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListOrderAtResourceGroupLevelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skipToken); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), DefaultClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetEdgeOrders", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderOrdersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skipToken, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderOrdersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skipToken, top); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), EdgeOrderOrdersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetEdgeOrders", "value", "nextLink", cancellationToken); } /// - /// Lists order at resource group level. + /// List orders at resource group level. /// /// /// Request Path @@ -93,18 +94,19 @@ public virtual AsyncPageable GetEdgeOrdersAsync(string skipTo /// /// /// Operation Id - /// ListOrderAtResourceGroupLevel + /// Orders_ListByResourceGroup /// /// /// - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetEdgeOrders(string skipToken = null, CancellationToken cancellationToken = default) + public virtual Pageable GetEdgeOrders(string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListOrderAtResourceGroupLevelRequest(Id.SubscriptionId, Id.ResourceGroupName, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListOrderAtResourceGroupLevelNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skipToken); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), DefaultClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetEdgeOrders", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderOrdersRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skipToken, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderOrdersRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skipToken, top); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), EdgeOrderOrdersClientDiagnostics, Pipeline, "ResourceGroupResourceExtensionClient.GetEdgeOrders", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs index cba04cc0f077..667fa0ebb0d6 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs @@ -17,12 +17,14 @@ namespace Azure.ResourceManager.EdgeOrder /// A class to add extension methods to SubscriptionResource. internal partial class SubscriptionResourceExtensionClient : ArmResource { - private ClientDiagnostics _edgeOrderAddressClientDiagnostics; - private EdgeOrderManagementRestOperations _edgeOrderAddressRestClient; - private ClientDiagnostics _defaultClientDiagnostics; - private EdgeOrderManagementRestOperations _defaultRestClient; - private ClientDiagnostics _edgeOrderItemClientDiagnostics; - private EdgeOrderManagementRestOperations _edgeOrderItemRestClient; + private ClientDiagnostics _edgeOrderAddressAddressesClientDiagnostics; + private AddressesRestOperations _edgeOrderAddressAddressesRestClient; + private ClientDiagnostics _productsAndConfigurationsClientDiagnostics; + private ProductsAndConfigurationsRestOperations _productsAndConfigurationsRestClient; + private ClientDiagnostics _edgeOrderItemOrderItemsClientDiagnostics; + private OrderItemsRestOperations _edgeOrderItemOrderItemsRestClient; + private ClientDiagnostics _edgeOrderOrdersClientDiagnostics; + private OrdersRestOperations _edgeOrderOrdersRestClient; /// Initializes a new instance of the class for mocking. protected SubscriptionResourceExtensionClient() @@ -36,12 +38,14 @@ internal SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifie { } - private ClientDiagnostics EdgeOrderAddressClientDiagnostics => _edgeOrderAddressClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", EdgeOrderAddressResource.ResourceType.Namespace, Diagnostics); - private EdgeOrderManagementRestOperations EdgeOrderAddressRestClient => _edgeOrderAddressRestClient ??= new EdgeOrderManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(EdgeOrderAddressResource.ResourceType)); - private ClientDiagnostics DefaultClientDiagnostics => _defaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private EdgeOrderManagementRestOperations DefaultRestClient => _defaultRestClient ??= new EdgeOrderManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics EdgeOrderItemClientDiagnostics => _edgeOrderItemClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", EdgeOrderItemResource.ResourceType.Namespace, Diagnostics); - private EdgeOrderManagementRestOperations EdgeOrderItemRestClient => _edgeOrderItemRestClient ??= new EdgeOrderManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(EdgeOrderItemResource.ResourceType)); + private ClientDiagnostics EdgeOrderAddressAddressesClientDiagnostics => _edgeOrderAddressAddressesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", EdgeOrderAddressResource.ResourceType.Namespace, Diagnostics); + private AddressesRestOperations EdgeOrderAddressAddressesRestClient => _edgeOrderAddressAddressesRestClient ??= new AddressesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(EdgeOrderAddressResource.ResourceType)); + private ClientDiagnostics ProductsAndConfigurationsClientDiagnostics => _productsAndConfigurationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private ProductsAndConfigurationsRestOperations ProductsAndConfigurationsRestClient => _productsAndConfigurationsRestClient ??= new ProductsAndConfigurationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics EdgeOrderItemOrderItemsClientDiagnostics => _edgeOrderItemOrderItemsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", EdgeOrderItemResource.ResourceType.Namespace, Diagnostics); + private OrderItemsRestOperations EdgeOrderItemOrderItemsRestClient => _edgeOrderItemOrderItemsRestClient ??= new OrderItemsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(EdgeOrderItemResource.ResourceType)); + private ClientDiagnostics EdgeOrderOrdersClientDiagnostics => _edgeOrderOrdersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.EdgeOrder", EdgeOrderResource.ResourceType.Namespace, Diagnostics); + private OrdersRestOperations EdgeOrderOrdersRestClient => _edgeOrderOrdersRestClient ??= new OrdersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(EdgeOrderResource.ResourceType)); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -50,7 +54,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) } /// - /// Lists all the addresses available under the subscription. + /// List all the addresses available under the subscription. /// /// /// Request Path @@ -58,23 +62,24 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Operation Id - /// ListAddressesAtSubscriptionLevel + /// Addresses_ListBySubscription /// /// /// /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetEdgeOrderAddressesAsync(string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetEdgeOrderAddressesAsync(string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderAddressRestClient.CreateListAddressesAtSubscriptionLevelRequest(Id.SubscriptionId, filter, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderAddressRestClient.CreateListAddressesAtSubscriptionLevelNextPageRequest(nextLink, Id.SubscriptionId, filter, skipToken); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderAddressResource(Client, EdgeOrderAddressData.DeserializeEdgeOrderAddressData(e)), EdgeOrderAddressClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrderAddresses", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderAddressAddressesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, skipToken, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderAddressAddressesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, skipToken, top); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderAddressResource(Client, EdgeOrderAddressData.DeserializeEdgeOrderAddressData(e)), EdgeOrderAddressAddressesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrderAddresses", "value", "nextLink", cancellationToken); } /// - /// Lists all the addresses available under the subscription. + /// List all the addresses available under the subscription. /// /// /// Request Path @@ -82,121 +87,122 @@ public virtual AsyncPageable GetEdgeOrderAddressesAsyn /// /// /// Operation Id - /// ListAddressesAtSubscriptionLevel + /// Addresses_ListBySubscription /// /// /// /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetEdgeOrderAddresses(string filter = null, string skipToken = null, CancellationToken cancellationToken = default) + public virtual Pageable GetEdgeOrderAddresses(string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderAddressRestClient.CreateListAddressesAtSubscriptionLevelRequest(Id.SubscriptionId, filter, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderAddressRestClient.CreateListAddressesAtSubscriptionLevelNextPageRequest(nextLink, Id.SubscriptionId, filter, skipToken); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderAddressResource(Client, EdgeOrderAddressData.DeserializeEdgeOrderAddressData(e)), EdgeOrderAddressClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrderAddresses", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderAddressAddressesRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, skipToken, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderAddressAddressesRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, skipToken, top); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderAddressResource(Client, EdgeOrderAddressData.DeserializeEdgeOrderAddressData(e)), EdgeOrderAddressAddressesClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrderAddresses", "value", "nextLink", cancellationToken); } /// - /// This method provides the list of product families for the given subscription. + /// List configurations for the given product family, product line and product for the given subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations /// /// /// Operation Id - /// ListProductFamilies + /// ProductsAndConfigurations_ListConfigurations /// /// /// - /// Filters for showing the product families. - /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. - /// $skipToken is supported on list of product families, which provides the next page in the list of product families. + /// Filters for showing the configurations. + /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetProductFamiliesAsync(ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetConfigurationsProductsAndConfigurationsAsync(ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListProductFamiliesRequest(Id.SubscriptionId, content, expand, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListProductFamiliesNextPageRequest(nextLink, Id.SubscriptionId, content, expand, skipToken); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProductFamily.DeserializeProductFamily, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProductFamilies", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ProductsAndConfigurationsRestClient.CreateListConfigurationsRequest(Id.SubscriptionId, content, skipToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProductsAndConfigurationsRestClient.CreateListConfigurationsNextPageRequest(nextLink, Id.SubscriptionId, content, skipToken); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProductConfiguration.DeserializeProductConfiguration, ProductsAndConfigurationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfigurationsProductsAndConfigurations", "value", "nextLink", cancellationToken); } /// - /// This method provides the list of product families for the given subscription. + /// List configurations for the given product family, product line and product for the given subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations /// /// /// Operation Id - /// ListProductFamilies + /// ProductsAndConfigurations_ListConfigurations /// /// /// - /// Filters for showing the product families. - /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. - /// $skipToken is supported on list of product families, which provides the next page in the list of product families. + /// Filters for showing the configurations. + /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetProductFamilies(ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetConfigurationsProductsAndConfigurations(ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListProductFamiliesRequest(Id.SubscriptionId, content, expand, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListProductFamiliesNextPageRequest(nextLink, Id.SubscriptionId, content, expand, skipToken); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProductFamily.DeserializeProductFamily, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProductFamilies", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ProductsAndConfigurationsRestClient.CreateListConfigurationsRequest(Id.SubscriptionId, content, skipToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProductsAndConfigurationsRestClient.CreateListConfigurationsNextPageRequest(nextLink, Id.SubscriptionId, content, skipToken); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProductConfiguration.DeserializeProductConfiguration, ProductsAndConfigurationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfigurationsProductsAndConfigurations", "value", "nextLink", cancellationToken); } /// - /// This method provides the list of configurations for the given product family, product line and product under subscription. + /// List product families for the given subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies /// /// /// Operation Id - /// ListConfigurations + /// ProductsAndConfigurations_ListProductFamilies /// /// /// - /// Filters for showing the configurations. - /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. + /// Filters for showing the product families. + /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. + /// $skipToken is supported on list of product families, which provides the next page in the list of product families. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetConfigurationsAsync(ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetProductFamiliesProductsAndConfigurationsAsync(ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListConfigurationsRequest(Id.SubscriptionId, content, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListConfigurationsNextPageRequest(nextLink, Id.SubscriptionId, content, skipToken); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProductConfiguration.DeserializeProductConfiguration, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfigurations", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ProductsAndConfigurationsRestClient.CreateListProductFamiliesRequest(Id.SubscriptionId, content, expand, skipToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProductsAndConfigurationsRestClient.CreateListProductFamiliesNextPageRequest(nextLink, Id.SubscriptionId, content, expand, skipToken); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProductFamily.DeserializeProductFamily, ProductsAndConfigurationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProductFamiliesProductsAndConfigurations", "value", "nextLink", cancellationToken); } /// - /// This method provides the list of configurations for the given product family, product line and product under subscription. + /// List product families for the given subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listConfigurations + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/listProductFamilies /// /// /// Operation Id - /// ListConfigurations + /// ProductsAndConfigurations_ListProductFamilies /// /// /// - /// Filters for showing the configurations. - /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. + /// Filters for showing the product families. + /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. + /// $skipToken is supported on list of product families, which provides the next page in the list of product families. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetConfigurations(ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetProductFamiliesProductsAndConfigurations(ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListConfigurationsRequest(Id.SubscriptionId, content, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListConfigurationsNextPageRequest(nextLink, Id.SubscriptionId, content, skipToken); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProductConfiguration.DeserializeProductConfiguration, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetConfigurations", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ProductsAndConfigurationsRestClient.CreateListProductFamiliesRequest(Id.SubscriptionId, content, expand, skipToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProductsAndConfigurationsRestClient.CreateListProductFamiliesNextPageRequest(nextLink, Id.SubscriptionId, content, expand, skipToken); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProductFamily.DeserializeProductFamily, ProductsAndConfigurationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProductFamiliesProductsAndConfigurations", "value", "nextLink", cancellationToken); } /// - /// This method provides the list of product families metadata for the given subscription. + /// List product families metadata for the given subscription. /// /// /// Request Path @@ -204,22 +210,22 @@ public virtual Pageable GetConfigurations(ConfigurationsCo /// /// /// Operation Id - /// ListProductFamiliesMetadata + /// ProductsAndConfigurations_ListProductFamiliesMetadata /// /// /// /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. /// The cancellation token to use. /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetProductFamiliesMetadataAsync(string skipToken = null, CancellationToken cancellationToken = default) + public virtual AsyncPageable GetProductFamiliesMetadataProductsAndConfigurationsAsync(string skipToken = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListProductFamiliesMetadataRequest(Id.SubscriptionId, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListProductFamiliesMetadataNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProductFamiliesMetadata.DeserializeProductFamiliesMetadata, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProductFamiliesMetadata", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ProductsAndConfigurationsRestClient.CreateListProductFamiliesMetadataRequest(Id.SubscriptionId, skipToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProductsAndConfigurationsRestClient.CreateListProductFamiliesMetadataNextPageRequest(nextLink, Id.SubscriptionId, skipToken); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, ProductFamiliesMetadata.DeserializeProductFamiliesMetadata, ProductsAndConfigurationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProductFamiliesMetadataProductsAndConfigurations", "value", "nextLink", cancellationToken); } /// - /// This method provides the list of product families metadata for the given subscription. + /// List product families metadata for the given subscription. /// /// /// Request Path @@ -227,114 +233,118 @@ public virtual AsyncPageable GetProductFamiliesMetadata /// /// /// Operation Id - /// ListProductFamiliesMetadata + /// ProductsAndConfigurations_ListProductFamiliesMetadata /// /// /// /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. /// The cancellation token to use. /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetProductFamiliesMetadata(string skipToken = null, CancellationToken cancellationToken = default) + public virtual Pageable GetProductFamiliesMetadataProductsAndConfigurations(string skipToken = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListProductFamiliesMetadataRequest(Id.SubscriptionId, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListProductFamiliesMetadataNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProductFamiliesMetadata.DeserializeProductFamiliesMetadata, DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProductFamiliesMetadata", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ProductsAndConfigurationsRestClient.CreateListProductFamiliesMetadataRequest(Id.SubscriptionId, skipToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ProductsAndConfigurationsRestClient.CreateListProductFamiliesMetadataNextPageRequest(nextLink, Id.SubscriptionId, skipToken); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, ProductFamiliesMetadata.DeserializeProductFamiliesMetadata, ProductsAndConfigurationsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetProductFamiliesMetadataProductsAndConfigurations", "value", "nextLink", cancellationToken); } /// - /// Lists order at subscription level. + /// List order items at subscription level. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems /// /// /// Operation Id - /// ListOrderAtSubscriptionLevel + /// OrderItems_ListBySubscription /// /// /// - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. + /// $filter is supported to filter based on order id. Filter supports only equals operation. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetEdgeOrdersAsync(string skipToken = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetEdgeOrderItemsAsync(string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListOrderAtSubscriptionLevelRequest(Id.SubscriptionId, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListOrderAtSubscriptionLevelNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrders", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderItemOrderItemsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, expand, skipToken, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderItemOrderItemsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, expand, skipToken, top); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderItemResource(Client, EdgeOrderItemData.DeserializeEdgeOrderItemData(e)), EdgeOrderItemOrderItemsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrderItems", "value", "nextLink", cancellationToken); } /// - /// Lists order at subscription level. + /// List order items at subscription level. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems /// /// /// Operation Id - /// ListOrderAtSubscriptionLevel + /// OrderItems_ListBySubscription /// /// /// - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. + /// $filter is supported to filter based on order id. Filter supports only equals operation. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetEdgeOrders(string skipToken = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetEdgeOrderItems(string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => DefaultRestClient.CreateListOrderAtSubscriptionLevelRequest(Id.SubscriptionId, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DefaultRestClient.CreateListOrderAtSubscriptionLevelNextPageRequest(nextLink, Id.SubscriptionId, skipToken); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), DefaultClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrders", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderItemOrderItemsRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, filter, expand, skipToken, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderItemOrderItemsRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, filter, expand, skipToken, top); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderItemResource(Client, EdgeOrderItemData.DeserializeEdgeOrderItemData(e)), EdgeOrderItemOrderItemsClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrderItems", "value", "nextLink", cancellationToken); } /// - /// Lists order item at subscription level. + /// List orders at subscription level. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders /// /// /// Operation Id - /// ListOrderItemsAtSubscriptionLevel + /// Orders_ListBySubscription /// /// /// - /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetEdgeOrderItemsAsync(string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetEdgeOrdersAsync(string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderItemRestClient.CreateListOrderItemsAtSubscriptionLevelRequest(Id.SubscriptionId, filter, expand, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderItemRestClient.CreateListOrderItemsAtSubscriptionLevelNextPageRequest(nextLink, Id.SubscriptionId, filter, expand, skipToken); - return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderItemResource(Client, EdgeOrderItemData.DeserializeEdgeOrderItemData(e)), EdgeOrderItemClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrderItems", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderOrdersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skipToken, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderOrdersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skipToken, top); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), EdgeOrderOrdersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrders", "value", "nextLink", cancellationToken); } /// - /// Lists order item at subscription level. + /// List orders at subscription level. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orderItems + /// /subscriptions/{subscriptionId}/providers/Microsoft.EdgeOrder/orders /// /// /// Operation Id - /// ListOrderItemsAtSubscriptionLevel + /// Orders_ListBySubscription /// /// /// - /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetEdgeOrderItems(string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetEdgeOrders(string skipToken = null, int? top = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderItemRestClient.CreateListOrderItemsAtSubscriptionLevelRequest(Id.SubscriptionId, filter, expand, skipToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderItemRestClient.CreateListOrderItemsAtSubscriptionLevelNextPageRequest(nextLink, Id.SubscriptionId, filter, expand, skipToken); - return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderItemResource(Client, EdgeOrderItemData.DeserializeEdgeOrderItemData(e)), EdgeOrderItemClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrderItems", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => EdgeOrderOrdersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId, skipToken, top); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => EdgeOrderOrdersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId, skipToken, top); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EdgeOrderResource(Client, EdgeOrderData.DeserializeEdgeOrderData(e)), EdgeOrderOrdersClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetEdgeOrders", "value", "nextLink", cancellationToken); } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/AdditionalConfiguration.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/AdditionalConfiguration.Serialization.cs new file mode 100644 index 000000000000..392cba4bb4bb --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/AdditionalConfiguration.Serialization.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + public partial class AdditionalConfiguration : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("hierarchyInformation"u8); + writer.WriteObjectValue(HierarchyInformation); + writer.WritePropertyName("quantity"u8); + writer.WriteNumberValue(Quantity); + writer.WriteEndObject(); + } + + internal static AdditionalConfiguration DeserializeAdditionalConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + HierarchyInformation hierarchyInformation = default; + int quantity = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hierarchyInformation"u8)) + { + hierarchyInformation = HierarchyInformation.DeserializeHierarchyInformation(property.Value); + continue; + } + if (property.NameEquals("quantity"u8)) + { + quantity = property.Value.GetInt32(); + continue; + } + } + return new AdditionalConfiguration(hierarchyInformation, quantity); + } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/AdditionalConfiguration.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/AdditionalConfiguration.cs new file mode 100644 index 000000000000..31ec87f5c6c5 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/AdditionalConfiguration.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + /// Additional Configuration details. + public partial class AdditionalConfiguration + { + /// Initializes a new instance of AdditionalConfiguration. + /// Hierarchy of the product which uniquely identifies the configuration. + /// Quantity of the product. + /// is null. + public AdditionalConfiguration(HierarchyInformation hierarchyInformation, int quantity) + { + Argument.AssertNotNull(hierarchyInformation, nameof(hierarchyInformation)); + + HierarchyInformation = hierarchyInformation; + Quantity = quantity; + } + + /// Hierarchy of the product which uniquely identifies the configuration. + public HierarchyInformation HierarchyInformation { get; set; } + /// Quantity of the product. + public int Quantity { get; set; } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/CategoryInformation.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/CategoryInformation.Serialization.cs new file mode 100644 index 000000000000..3e158c5a2eca --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/CategoryInformation.Serialization.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + public partial class CategoryInformation + { + internal static CategoryInformation DeserializeCategoryInformation(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional categoryName = default; + Optional categoryDisplayName = default; + Optional description = default; + Optional> links = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("categoryName"u8)) + { + categoryName = property.Value.GetString(); + continue; + } + if (property.NameEquals("categoryDisplayName"u8)) + { + categoryDisplayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("links"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ProductLink.DeserializeProductLink(item)); + } + links = array; + continue; + } + } + return new CategoryInformation(categoryName.Value, categoryDisplayName.Value, description.Value, Optional.ToList(links)); + } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/CategoryInformation.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/CategoryInformation.cs new file mode 100644 index 000000000000..6573f4ec105f --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/CategoryInformation.cs @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + /// Category related properties of a child configuration. + public partial class CategoryInformation + { + /// Initializes a new instance of CategoryInformation. + internal CategoryInformation() + { + Links = new ChangeTrackingList(); + } + + /// Initializes a new instance of CategoryInformation. + /// Category name of the child configuration. + /// Category display name of the child configuration. + /// Description text for the category. + /// Links for the category. + internal CategoryInformation(string categoryName, string categoryDisplayName, string description, IReadOnlyList links) + { + CategoryName = categoryName; + CategoryDisplayName = categoryDisplayName; + Description = description; + Links = links; + } + + /// Category name of the child configuration. + public string CategoryName { get; } + /// Category display name of the child configuration. + public string CategoryDisplayName { get; } + /// Description text for the category. + public string Description { get; } + /// Links for the category. + public IReadOnlyList Links { get; } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfiguration.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfiguration.Serialization.cs new file mode 100644 index 000000000000..559d257e5289 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfiguration.Serialization.cs @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + public partial class ChildConfiguration + { + internal static ChildConfiguration DeserializeChildConfiguration(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional childConfigurationType = default; + Optional isPartOfBaseConfiguration = default; + Optional minimumQuantity = default; + Optional maximumQuantity = default; + Optional> specifications = default; + Optional dimensions = default; + Optional> childConfigurationTypes = default; + Optional> groupedChildConfigurations = default; + Optional> filterableProperties = default; + Optional displayName = default; + Optional description = default; + Optional> imageInformation = default; + Optional costInformation = default; + Optional availabilityInformation = default; + Optional hierarchyInformation = default; + Optional fulfilledBy = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("childConfigurationType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + childConfigurationType = new ChildConfigurationType(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("isPartOfBaseConfiguration"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + isPartOfBaseConfiguration = property0.Value.GetBoolean(); + continue; + } + if (property0.NameEquals("minimumQuantity"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + minimumQuantity = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("maximumQuantity"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + maximumQuantity = property0.Value.GetInt32(); + continue; + } + if (property0.NameEquals("specifications"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(ProductSpecification.DeserializeProductSpecification(item)); + } + specifications = array; + continue; + } + if (property0.NameEquals("dimensions"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + dimensions = ProductDimensions.DeserializeProductDimensions(property0.Value); + continue; + } + if (property0.NameEquals("childConfigurationTypes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new ChildConfigurationType(item.GetString())); + } + childConfigurationTypes = array; + continue; + } + if (property0.NameEquals("groupedChildConfigurations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(Models.GroupedChildConfigurations.DeserializeGroupedChildConfigurations(item)); + } + groupedChildConfigurations = array; + continue; + } + if (property0.NameEquals("filterableProperties"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(FilterableProperty.DeserializeFilterableProperty(item)); + } + filterableProperties = array; + continue; + } + if (property0.NameEquals("displayName"u8)) + { + displayName = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("description"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + description = ProductDescription.DeserializeProductDescription(property0.Value); + continue; + } + if (property0.NameEquals("imageInformation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(EdgeOrderProductImageInformation.DeserializeEdgeOrderProductImageInformation(item)); + } + imageInformation = array; + continue; + } + if (property0.NameEquals("costInformation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + costInformation = EdgeOrderProductCostInformation.DeserializeEdgeOrderProductCostInformation(property0.Value); + continue; + } + if (property0.NameEquals("availabilityInformation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + availabilityInformation = ProductAvailabilityInformation.DeserializeProductAvailabilityInformation(property0.Value); + continue; + } + if (property0.NameEquals("hierarchyInformation"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + hierarchyInformation = HierarchyInformation.DeserializeHierarchyInformation(property0.Value); + continue; + } + if (property0.NameEquals("fulfilledBy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + fulfilledBy = new FulfillmentType(property0.Value.GetString()); + continue; + } + } + continue; + } + } + return new ChildConfiguration(Optional.ToNullable(childConfigurationType), Optional.ToNullable(isPartOfBaseConfiguration), Optional.ToNullable(minimumQuantity), Optional.ToNullable(maximumQuantity), Optional.ToList(specifications), dimensions.Value, Optional.ToList(childConfigurationTypes), Optional.ToList(groupedChildConfigurations), Optional.ToList(filterableProperties), displayName.Value, description.Value, Optional.ToList(imageInformation), costInformation.Value, availabilityInformation.Value, hierarchyInformation.Value, Optional.ToNullable(fulfilledBy)); + } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfiguration.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfiguration.cs new file mode 100644 index 000000000000..03d6651f5551 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfiguration.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + /// Child configuration object. + public partial class ChildConfiguration + { + /// Initializes a new instance of ChildConfiguration. + internal ChildConfiguration() + { + Specifications = new ChangeTrackingList(); + ChildConfigurationTypes = new ChangeTrackingList(); + GroupedChildConfigurations = new ChangeTrackingList(); + FilterableProperties = new ChangeTrackingList(); + ImageInformation = new ChangeTrackingList(); + } + + /// Initializes a new instance of ChildConfiguration. + /// Child configuration type. + /// Flag to indicate if the child configuration is part of the base configuration, which means the customer need not pass this configuration in OptInAdditionalConfigurations while placing an order, it will be shipped by default. + /// Minimum quantity a customer can order while choosing this configuration. + /// Maximum quantity a customer can order while choosing this configuration. + /// Specifications of the configuration. + /// Dimensions of the configuration. + /// Different types of child configurations which exist for this configuration, these can be used to populate the child configuration filter. + /// Child configurations present for the configuration after applying child configuration filter, grouped by the category name of the child configuration. + /// List of filters supported for a product. + /// Display Name for the product system. + /// Description related to the product system. + /// Image information for the product system. + /// Cost information for the product system. + /// Availability information of the product system. + /// Hierarchy information of a product. + /// The entity responsible for fulfillment of the item at the given hierarchy level. + internal ChildConfiguration(ChildConfigurationType? childConfigurationType, bool? isPartOfBaseConfiguration, int? minimumQuantity, int? maximumQuantity, IReadOnlyList specifications, ProductDimensions dimensions, IReadOnlyList childConfigurationTypes, IReadOnlyList groupedChildConfigurations, IReadOnlyList filterableProperties, string displayName, ProductDescription description, IReadOnlyList imageInformation, EdgeOrderProductCostInformation costInformation, ProductAvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, FulfillmentType? fulfilledBy) + { + ChildConfigurationType = childConfigurationType; + IsPartOfBaseConfiguration = isPartOfBaseConfiguration; + MinimumQuantity = minimumQuantity; + MaximumQuantity = maximumQuantity; + Specifications = specifications; + Dimensions = dimensions; + ChildConfigurationTypes = childConfigurationTypes; + GroupedChildConfigurations = groupedChildConfigurations; + FilterableProperties = filterableProperties; + DisplayName = displayName; + Description = description; + ImageInformation = imageInformation; + CostInformation = costInformation; + AvailabilityInformation = availabilityInformation; + HierarchyInformation = hierarchyInformation; + FulfilledBy = fulfilledBy; + } + + /// Child configuration type. + public ChildConfigurationType? ChildConfigurationType { get; } + /// Flag to indicate if the child configuration is part of the base configuration, which means the customer need not pass this configuration in OptInAdditionalConfigurations while placing an order, it will be shipped by default. + public bool? IsPartOfBaseConfiguration { get; } + /// Minimum quantity a customer can order while choosing this configuration. + public int? MinimumQuantity { get; } + /// Maximum quantity a customer can order while choosing this configuration. + public int? MaximumQuantity { get; } + /// Specifications of the configuration. + public IReadOnlyList Specifications { get; } + /// Dimensions of the configuration. + public ProductDimensions Dimensions { get; } + /// Different types of child configurations which exist for this configuration, these can be used to populate the child configuration filter. + public IReadOnlyList ChildConfigurationTypes { get; } + /// Child configurations present for the configuration after applying child configuration filter, grouped by the category name of the child configuration. + public IReadOnlyList GroupedChildConfigurations { get; } + /// List of filters supported for a product. + public IReadOnlyList FilterableProperties { get; } + /// Display Name for the product system. + public string DisplayName { get; } + /// Description related to the product system. + public ProductDescription Description { get; } + /// Image information for the product system. + public IReadOnlyList ImageInformation { get; } + /// Cost information for the product system. + public EdgeOrderProductCostInformation CostInformation { get; } + /// Availability information of the product system. + public ProductAvailabilityInformation AvailabilityInformation { get; } + /// Hierarchy information of a product. + public HierarchyInformation HierarchyInformation { get; } + /// The entity responsible for fulfillment of the item at the given hierarchy level. + public FulfillmentType? FulfilledBy { get; } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfigurationFilter.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfigurationFilter.Serialization.cs new file mode 100644 index 000000000000..3fb20648a0d8 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfigurationFilter.Serialization.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + public partial class ChildConfigurationFilter : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(HierarchyInformations)) + { + writer.WritePropertyName("hierarchyInformations"u8); + writer.WriteStartArray(); + foreach (var item in HierarchyInformations) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ChildConfigurationTypes)) + { + writer.WritePropertyName("childConfigurationTypes"u8); + writer.WriteStartArray(); + foreach (var item in ChildConfigurationTypes) + { + writer.WriteStringValue(item.ToString()); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfigurationFilter.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfigurationFilter.cs new file mode 100644 index 000000000000..676f2eab77cf --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfigurationFilter.cs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + /// Child configuration filter. + public partial class ChildConfigurationFilter + { + /// Initializes a new instance of ChildConfigurationFilter. + public ChildConfigurationFilter() + { + HierarchyInformations = new ChangeTrackingList(); + ChildConfigurationTypes = new ChangeTrackingList(); + } + + /// The list of child configuration hierarchy customer wants to filter for the given configuration. + public IList HierarchyInformations { get; } + /// Filter to fetch all child configurations belonging to the given list of configuration types. + public IList ChildConfigurationTypes { get; } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfigurationType.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfigurationType.cs new file mode 100644 index 000000000000..0484dc3d9532 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ChildConfigurationType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + /// The ChildConfigurationType. + public readonly partial struct ChildConfigurationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ChildConfigurationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeviceConfigurationValue = "DeviceConfiguration"; + private const string AdditionalConfigurationValue = "AdditionalConfiguration"; + + /// Child configuration is a device configuration. + public static ChildConfigurationType DeviceConfiguration { get; } = new ChildConfigurationType(DeviceConfigurationValue); + /// Child configuration is an additional configuration. + public static ChildConfigurationType AdditionalConfiguration { get; } = new ChildConfigurationType(AdditionalConfigurationValue); + /// Determines if two values are the same. + public static bool operator ==(ChildConfigurationType left, ChildConfigurationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ChildConfigurationType left, ChildConfigurationType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator ChildConfigurationType(string value) => new ChildConfigurationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ChildConfigurationType other && Equals(other); + /// + public bool Equals(ChildConfigurationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationDeviceDetails.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationDeviceDetails.Serialization.cs new file mode 100644 index 000000000000..1c248bc0eab7 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationDeviceDetails.Serialization.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + public partial class ConfigurationDeviceDetails + { + internal static ConfigurationDeviceDetails DeserializeConfigurationDeviceDetails(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional displayInfo = default; + Optional hierarchyInformation = default; + Optional quantity = default; + Optional identificationType = default; + Optional> deviceDetails = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayInfo"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + displayInfo = ProductDisplayInfo.DeserializeProductDisplayInfo(property.Value); + continue; + } + if (property.NameEquals("hierarchyInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + hierarchyInformation = HierarchyInformation.DeserializeHierarchyInformation(property.Value); + continue; + } + if (property.NameEquals("quantity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + quantity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("identificationType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + identificationType = new IdentificationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("deviceDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(EdgeOrderProductDeviceDetails.DeserializeEdgeOrderProductDeviceDetails(item)); + } + deviceDetails = array; + continue; + } + } + return new ConfigurationDeviceDetails(displayInfo.Value, hierarchyInformation.Value, Optional.ToNullable(quantity), Optional.ToNullable(identificationType), Optional.ToList(deviceDetails)); + } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationDeviceDetails.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationDeviceDetails.cs new file mode 100644 index 000000000000..bb1307631f86 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationDeviceDetails.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + /// Device details for configuration. + public partial class ConfigurationDeviceDetails + { + /// Initializes a new instance of ConfigurationDeviceDetails. + internal ConfigurationDeviceDetails() + { + DeviceDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of ConfigurationDeviceDetails. + /// Display details of the product. + /// Hierarchy of the product which uniquely identifies the configuration. + /// Quantity of the product. + /// Identification type of the configuration. + /// List of device details. + internal ConfigurationDeviceDetails(ProductDisplayInfo displayInfo, HierarchyInformation hierarchyInformation, int? quantity, IdentificationType? identificationType, IReadOnlyList deviceDetails) + { + DisplayInfo = displayInfo; + HierarchyInformation = hierarchyInformation; + Quantity = quantity; + IdentificationType = identificationType; + DeviceDetails = deviceDetails; + } + + /// Display details of the product. + public ProductDisplayInfo DisplayInfo { get; } + /// Hierarchy of the product which uniquely identifies the configuration. + public HierarchyInformation HierarchyInformation { get; } + /// Quantity of the product. + public int? Quantity { get; } + /// Identification type of the configuration. + public IdentificationType? IdentificationType { get; } + /// List of device details. + public IReadOnlyList DeviceDetails { get; } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationFilters.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationFilter.Serialization.cs similarity index 75% rename from sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationFilters.Serialization.cs rename to sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationFilter.Serialization.cs index 49cb8ee9d7e0..131508251baf 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationFilters.Serialization.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationFilter.Serialization.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.EdgeOrder.Models { - public partial class ConfigurationFilters : IUtf8JsonSerializable + public partial class ConfigurationFilter : IUtf8JsonSerializable { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { @@ -27,6 +27,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(ChildConfigurationFilter)) + { + writer.WritePropertyName("childConfigurationFilter"u8); + writer.WriteObjectValue(ChildConfigurationFilter); + } writer.WriteEndObject(); } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationFilters.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationFilter.cs similarity index 69% rename from sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationFilters.cs rename to sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationFilter.cs index a6d24ebda888..dad01f57a884 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationFilters.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationFilter.cs @@ -12,12 +12,12 @@ namespace Azure.ResourceManager.EdgeOrder.Models { /// Configuration filters. - public partial class ConfigurationFilters + public partial class ConfigurationFilter { - /// Initializes a new instance of ConfigurationFilters. + /// Initializes a new instance of ConfigurationFilter. /// Product hierarchy information. /// is null. - public ConfigurationFilters(HierarchyInformation hierarchyInformation) + public ConfigurationFilter(HierarchyInformation hierarchyInformation) { Argument.AssertNotNull(hierarchyInformation, nameof(hierarchyInformation)); @@ -29,5 +29,7 @@ public ConfigurationFilters(HierarchyInformation hierarchyInformation) public HierarchyInformation HierarchyInformation { get; } /// Filters specific to product. public IList FilterableProperty { get; } + /// Filter to fetch specific child configurations that exist in the configuration. This must be passed to either fetch a list of specific child configurations, or all child configurations of specific types of child configurations. + public ChildConfigurationFilter ChildConfigurationFilter { get; set; } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationsContent.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationsContent.Serialization.cs index 3e0a36fb238e..38ed8f83135b 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationsContent.Serialization.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationsContent.Serialization.cs @@ -15,13 +15,11 @@ public partial class ConfigurationsContent : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) { writer.WriteStartObject(); - writer.WritePropertyName("configurationFilters"u8); - writer.WriteStartArray(); - foreach (var item in ConfigurationFilters) + if (Optional.IsDefined(ConfigurationFilter)) { - writer.WriteObjectValue(item); + writer.WritePropertyName("configurationFilter"u8); + writer.WriteObjectValue(ConfigurationFilter); } - writer.WriteEndArray(); if (Optional.IsDefined(CustomerSubscriptionDetails)) { writer.WritePropertyName("customerSubscriptionDetails"u8); diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationsContent.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationsContent.cs index 70efc1c52ab8..656378ca77c3 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationsContent.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ConfigurationsContent.cs @@ -5,28 +5,18 @@ #nullable disable -using System; -using System.Collections.Generic; -using System.Linq; -using Azure.Core; - namespace Azure.ResourceManager.EdgeOrder.Models { /// Configuration request object. public partial class ConfigurationsContent { /// Initializes a new instance of ConfigurationsContent. - /// Holds details about product hierarchy information and filterable property. - /// is null. - public ConfigurationsContent(IEnumerable configurationFilters) + public ConfigurationsContent() { - Argument.AssertNotNull(configurationFilters, nameof(configurationFilters)); - - ConfigurationFilters = configurationFilters.ToList(); } /// Holds details about product hierarchy information and filterable property. - public IList ConfigurationFilters { get; } + public ConfigurationFilter ConfigurationFilter { get; set; } /// Customer subscription properties. Clients can display available products to unregistered customers by explicitly passing subscription details. public CustomerSubscriptionDetails CustomerSubscriptionDetails { get; set; } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderData.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderData.Serialization.cs index a3a0e0fd997a..56963ac72854 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderData.Serialization.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderData.Serialization.cs @@ -37,6 +37,7 @@ internal static EdgeOrderData DeserializeEdgeOrderData(JsonElement element) Optional> orderItemIds = default; Optional currentStage = default; Optional> orderStageHistory = default; + Optional orderMode = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id"u8)) @@ -120,11 +121,21 @@ internal static EdgeOrderData DeserializeEdgeOrderData(JsonElement element) orderStageHistory = array; continue; } + if (property0.NameEquals("orderMode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + orderMode = new OrderMode(property0.Value.GetString()); + continue; + } } continue; } } - return new EdgeOrderData(id, name, type, systemData.Value, Optional.ToList(orderItemIds), currentStage.Value, Optional.ToList(orderStageHistory)); + return new EdgeOrderData(id, name, type, systemData.Value, Optional.ToList(orderItemIds), currentStage.Value, Optional.ToList(orderStageHistory), Optional.ToNullable(orderMode)); } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemAddressDetails.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemAddressDetails.cs index dfb5934cf1e6..6079fb5ae982 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemAddressDetails.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemAddressDetails.cs @@ -14,7 +14,7 @@ namespace Azure.ResourceManager.EdgeOrder.Models public partial class EdgeOrderItemAddressDetails { /// Initializes a new instance of EdgeOrderItemAddressDetails. - /// Customer address and contact details. It should be address resource. + /// Customer address and contact details. /// is null. public EdgeOrderItemAddressDetails(EdgeOrderItemAddressProperties forwardAddress) { @@ -24,7 +24,7 @@ public EdgeOrderItemAddressDetails(EdgeOrderItemAddressProperties forwardAddress } /// Initializes a new instance of EdgeOrderItemAddressDetails. - /// Customer address and contact details. It should be address resource. + /// Customer address and contact details. /// Return shipping address. internal EdgeOrderItemAddressDetails(EdgeOrderItemAddressProperties forwardAddress, EdgeOrderItemAddressProperties returnAddress) { @@ -32,7 +32,7 @@ internal EdgeOrderItemAddressDetails(EdgeOrderItemAddressProperties forwardAddre ReturnAddress = returnAddress; } - /// Customer address and contact details. It should be address resource. + /// Customer address and contact details. public EdgeOrderItemAddressProperties ForwardAddress { get; set; } /// Return shipping address. public EdgeOrderItemAddressProperties ReturnAddress { get; } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemDetails.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemDetails.Serialization.cs index 8030b0f98a68..2ac218f81d20 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemDetails.Serialization.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemDetails.Serialization.cs @@ -21,6 +21,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WriteObjectValue(ProductDetails); writer.WritePropertyName("orderItemType"u8); writer.WriteStringValue(OrderItemType.ToString()); + if (Optional.IsDefined(OrderItemMode)) + { + writer.WritePropertyName("orderItemMode"u8); + writer.WriteStringValue(OrderItemMode.Value.ToString()); + } if (Optional.IsDefined(Preferences)) { writer.WritePropertyName("preferences"u8); @@ -47,6 +52,7 @@ internal static EdgeOrderItemDetails DeserializeEdgeOrderItemDetails(JsonElement } ProductDetails productDetails = default; OrderItemType orderItemType = default; + Optional orderItemMode = default; Optional currentStage = default; Optional> orderItemStageHistory = default; Optional preferences = default; @@ -58,7 +64,6 @@ internal static EdgeOrderItemDetails DeserializeEdgeOrderItemDetails(JsonElement Optional deletionStatus = default; Optional returnReason = default; Optional returnStatus = default; - Optional managementRPDetails = default; Optional> managementRPDetailsList = default; Optional error = default; foreach (var property in element.EnumerateObject()) @@ -73,6 +78,16 @@ internal static EdgeOrderItemDetails DeserializeEdgeOrderItemDetails(JsonElement orderItemType = new OrderItemType(property.Value.GetString()); continue; } + if (property.NameEquals("orderItemMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + orderItemMode = new OrderMode(property.Value.GetString()); + continue; + } if (property.NameEquals("currentStage"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -183,16 +198,6 @@ internal static EdgeOrderItemDetails DeserializeEdgeOrderItemDetails(JsonElement returnStatus = new OrderItemReturnStatus(property.Value.GetString()); continue; } - if (property.NameEquals("managementRpDetails"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - property.ThrowNonNullablePropertyIsNull(); - continue; - } - managementRPDetails = ResourceProviderDetails.DeserializeResourceProviderDetails(property.Value); - continue; - } if (property.NameEquals("managementRpDetailsList"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -219,7 +224,7 @@ internal static EdgeOrderItemDetails DeserializeEdgeOrderItemDetails(JsonElement continue; } } - return new EdgeOrderItemDetails(productDetails, orderItemType, currentStage.Value, Optional.ToList(orderItemStageHistory), preferences.Value, forwardShippingDetails.Value, reverseShippingDetails.Value, Optional.ToList(notificationEmailList), cancellationReason.Value, Optional.ToNullable(cancellationStatus), Optional.ToNullable(deletionStatus), returnReason.Value, Optional.ToNullable(returnStatus), managementRPDetails.Value, Optional.ToList(managementRPDetailsList), error.Value); + return new EdgeOrderItemDetails(productDetails, orderItemType, Optional.ToNullable(orderItemMode), currentStage.Value, Optional.ToList(orderItemStageHistory), preferences.Value, forwardShippingDetails.Value, reverseShippingDetails.Value, Optional.ToList(notificationEmailList), cancellationReason.Value, Optional.ToNullable(cancellationStatus), Optional.ToNullable(deletionStatus), returnReason.Value, Optional.ToNullable(returnStatus), Optional.ToList(managementRPDetailsList), error.Value); } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemDetails.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemDetails.cs index 8d65fb4ab395..577a8ad94fc6 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemDetails.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemDetails.cs @@ -33,6 +33,7 @@ public EdgeOrderItemDetails(ProductDetails productDetails, OrderItemType orderIt /// Initializes a new instance of EdgeOrderItemDetails. /// Unique identifier for configuration. /// Order item type. + /// Defines the mode of the Order item. /// Current Order item Status. /// Order item status history. /// Customer notification Preferences. @@ -44,13 +45,13 @@ public EdgeOrderItemDetails(ProductDetails productDetails, OrderItemType orderIt /// Describes whether the order item is deletable or not. /// Return reason. /// Describes whether the order item is returnable or not. - /// Parent RP details - this returns only the first or default parent RP from the entire list. /// List of parent RP details supported for configuration. /// Top level error for the job. - internal EdgeOrderItemDetails(ProductDetails productDetails, OrderItemType orderItemType, EdgeOrderStageDetails currentStage, IReadOnlyList orderItemStageHistory, OrderItemPreferences preferences, ForwardShippingDetails forwardShippingDetails, ReverseShippingDetails reverseShippingDetails, IList notificationEmailList, string cancellationReason, OrderItemCancellationStatus? cancellationStatus, EdgeOrderActionStatus? deletionStatus, string returnReason, OrderItemReturnStatus? returnStatus, ResourceProviderDetails firstOrDefaultManagement, IReadOnlyList managementRPDetailsList, ResponseError error) + internal EdgeOrderItemDetails(ProductDetails productDetails, OrderItemType orderItemType, OrderMode? orderItemMode, EdgeOrderStageDetails currentStage, IReadOnlyList orderItemStageHistory, OrderItemPreferences preferences, ForwardShippingDetails forwardShippingDetails, ReverseShippingDetails reverseShippingDetails, IList notificationEmailList, string cancellationReason, OrderItemCancellationStatus? cancellationStatus, EdgeOrderActionStatus? deletionStatus, string returnReason, OrderItemReturnStatus? returnStatus, IReadOnlyList managementRPDetailsList, ResponseError error) { ProductDetails = productDetails; OrderItemType = orderItemType; + OrderItemMode = orderItemMode; CurrentStage = currentStage; OrderItemStageHistory = orderItemStageHistory; Preferences = preferences; @@ -62,7 +63,6 @@ internal EdgeOrderItemDetails(ProductDetails productDetails, OrderItemType order DeletionStatus = deletionStatus; ReturnReason = returnReason; ReturnStatus = returnStatus; - FirstOrDefaultManagement = firstOrDefaultManagement; ManagementRPDetailsList = managementRPDetailsList; Error = error; } @@ -71,6 +71,8 @@ internal EdgeOrderItemDetails(ProductDetails productDetails, OrderItemType order public ProductDetails ProductDetails { get; set; } /// Order item type. public OrderItemType OrderItemType { get; set; } + /// Defines the mode of the Order item. + public OrderMode? OrderItemMode { get; set; } /// Current Order item Status. public EdgeOrderStageDetails CurrentStage { get; } /// Order item status history. @@ -93,14 +95,6 @@ internal EdgeOrderItemDetails(ProductDetails productDetails, OrderItemType order public string ReturnReason { get; } /// Describes whether the order item is returnable or not. public OrderItemReturnStatus? ReturnStatus { get; } - /// Parent RP details - this returns only the first or default parent RP from the entire list. - internal ResourceProviderDetails FirstOrDefaultManagement { get; } - /// Resource provider namespace. - public string FirstOrDefaultManagementResourceProviderNamespace - { - get => FirstOrDefaultManagement?.ResourceProviderNamespace; - } - /// List of parent RP details supported for configuration. public IReadOnlyList ManagementRPDetailsList { get; } /// Top level error for the job. diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemReturnContent.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemReturnContent.cs index 4bf8a9423dd8..ad3917a7a514 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemReturnContent.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderItemReturnContent.cs @@ -23,7 +23,7 @@ public EdgeOrderItemReturnContent(string returnReason) ReturnReason = returnReason; } - /// customer return address. + /// Customer return address. public EdgeOrderItemAddressProperties ReturnAddress { get; set; } /// Return Reason. public string ReturnReason { get; } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProduct.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProduct.Serialization.cs index 07529d2757d3..822222cdf467 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProduct.Serialization.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProduct.Serialization.cs @@ -25,6 +25,7 @@ internal static EdgeOrderProduct DeserializeEdgeOrderProduct(JsonElement element Optional costInformation = default; Optional availabilityInformation = default; Optional hierarchyInformation = default; + Optional fulfilledBy = default; Optional> filterableProperties = default; Optional> configurations = default; foreach (var property in element.EnumerateObject()) @@ -98,6 +99,16 @@ internal static EdgeOrderProduct DeserializeEdgeOrderProduct(JsonElement element hierarchyInformation = HierarchyInformation.DeserializeHierarchyInformation(property0.Value); continue; } + if (property0.NameEquals("fulfilledBy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + fulfilledBy = new FulfillmentType(property0.Value.GetString()); + continue; + } if (property0.NameEquals("filterableProperties"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -132,7 +143,7 @@ internal static EdgeOrderProduct DeserializeEdgeOrderProduct(JsonElement element continue; } } - return new EdgeOrderProduct(displayName.Value, description.Value, Optional.ToList(imageInformation), costInformation.Value, availabilityInformation.Value, hierarchyInformation.Value, Optional.ToList(filterableProperties), Optional.ToList(configurations)); + return new EdgeOrderProduct(displayName.Value, description.Value, Optional.ToList(imageInformation), costInformation.Value, availabilityInformation.Value, hierarchyInformation.Value, Optional.ToNullable(fulfilledBy), Optional.ToList(filterableProperties), Optional.ToList(configurations)); } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProduct.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProduct.cs index 40f05c5fed10..7479dc2b7505 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProduct.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProduct.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.EdgeOrder.Models { - /// List of Products. + /// Represents a product. public partial class EdgeOrderProduct { /// Initializes a new instance of EdgeOrderProduct. @@ -28,9 +28,10 @@ internal EdgeOrderProduct() /// Cost information for the product system. /// Availability information of the product system. /// Hierarchy information of a product. - /// list of filters supported for a product. + /// The entity responsible for fulfillment of the item at the given hierarchy level. + /// List of filters supported for a product. /// List of configurations for the product. - internal EdgeOrderProduct(string displayName, ProductDescription description, IReadOnlyList imageInformation, EdgeOrderProductCostInformation costInformation, ProductAvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, IReadOnlyList filterableProperties, IReadOnlyList configurations) + internal EdgeOrderProduct(string displayName, ProductDescription description, IReadOnlyList imageInformation, EdgeOrderProductCostInformation costInformation, ProductAvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, FulfillmentType? fulfilledBy, IReadOnlyList filterableProperties, IReadOnlyList configurations) { DisplayName = displayName; Description = description; @@ -38,6 +39,7 @@ internal EdgeOrderProduct(string displayName, ProductDescription description, IR CostInformation = costInformation; AvailabilityInformation = availabilityInformation; HierarchyInformation = hierarchyInformation; + FulfilledBy = fulfilledBy; FilterableProperties = filterableProperties; Configurations = configurations; } @@ -54,7 +56,9 @@ internal EdgeOrderProduct(string displayName, ProductDescription description, IR public ProductAvailabilityInformation AvailabilityInformation { get; } /// Hierarchy information of a product. public HierarchyInformation HierarchyInformation { get; } - /// list of filters supported for a product. + /// The entity responsible for fulfillment of the item at the given hierarchy level. + public FulfillmentType? FulfilledBy { get; } + /// List of filters supported for a product. public IReadOnlyList FilterableProperties { get; } /// List of configurations for the product. public IReadOnlyList Configurations { get; } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProductBillingMeterDetails.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProductBillingMeterDetails.cs index d19a0dc30ed8..96647c966b46 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProductBillingMeterDetails.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProductBillingMeterDetails.cs @@ -18,7 +18,7 @@ internal EdgeOrderProductBillingMeterDetails() /// Initializes a new instance of EdgeOrderProductBillingMeterDetails. /// Represents Billing type name. /// - /// Represents MeterDetails + /// Represents MeterDetails. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// @@ -35,7 +35,7 @@ internal EdgeOrderProductBillingMeterDetails(string name, EdgeOrderProductMeterD /// Represents Billing type name. public string Name { get; } /// - /// Represents MeterDetails + /// Represents MeterDetails. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProductDeviceDetails.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProductDeviceDetails.cs index 48638f8ee8df..274c7f736ac1 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProductDeviceDetails.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProductDeviceDetails.cs @@ -16,7 +16,7 @@ internal EdgeOrderProductDeviceDetails() } /// Initializes a new instance of EdgeOrderProductDeviceDetails. - /// device serial number. + /// Device serial number. /// Management Resource Id. /// Management Resource Tenant ID. internal EdgeOrderProductDeviceDetails(string serialNumber, string managementResourceId, string managementResourceTenantId) @@ -26,7 +26,7 @@ internal EdgeOrderProductDeviceDetails(string serialNumber, string managementRes ManagementResourceTenantId = managementResourceTenantId; } - /// device serial number. + /// Device serial number. public string SerialNumber { get; } /// Management Resource Id. public string ManagementResourceId { get; } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProductMeterDetails.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProductMeterDetails.cs index 20a25175dde6..fa83dd51034f 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProductMeterDetails.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderProductMeterDetails.cs @@ -8,7 +8,7 @@ namespace Azure.ResourceManager.EdgeOrder.Models { /// - /// Holds details about billing type and its meter guids + /// Holds details about billing type and its meter guids. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderStageName.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderStageName.cs index 050018e02905..8d3148c491ea 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderStageName.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/EdgeOrderStageName.cs @@ -51,9 +51,9 @@ public EdgeOrderStageName(string value) public static EdgeOrderStageName InUse { get; } = new EdgeOrderStageName(InUseValue); /// Return has been initiated by customer. public static EdgeOrderStageName ReturnInitiated { get; } = new EdgeOrderStageName(ReturnInitiatedValue); - /// Order is in transit from customer to microsoft. + /// Order is in transit from customer to Microsoft. public static EdgeOrderStageName ReturnPickedUp { get; } = new EdgeOrderStageName(ReturnPickedUpValue); - /// Order has been received back to microsoft. + /// Order has been received back to Microsoft. public static EdgeOrderStageName ReturnedToMicrosoft { get; } = new EdgeOrderStageName(ReturnedToMicrosoftValue); /// Return has now completed. public static EdgeOrderStageName ReturnCompleted { get; } = new EdgeOrderStageName(ReturnCompletedValue); diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/FulfillmentType.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/FulfillmentType.cs new file mode 100644 index 000000000000..c328aee38111 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/FulfillmentType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + /// The entity responsible for fulfillment of the item at the given hierarchy level. + public readonly partial struct FulfillmentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FulfillmentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MicrosoftValue = "Microsoft"; + private const string ExternalValue = "External"; + + /// The fulfillment (the whole journey of the product offering) is handled by microsoft. + public static FulfillmentType Microsoft { get; } = new FulfillmentType(MicrosoftValue); + /// The fulfillment (the whole journey of the product offering) is handled by external third party entities. + public static FulfillmentType External { get; } = new FulfillmentType(ExternalValue); + /// Determines if two values are the same. + public static bool operator ==(FulfillmentType left, FulfillmentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FulfillmentType left, FulfillmentType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator FulfillmentType(string value) => new FulfillmentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FulfillmentType other && Equals(other); + /// + public bool Equals(FulfillmentType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/GroupedChildConfigurations.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/GroupedChildConfigurations.Serialization.cs new file mode 100644 index 000000000000..1eb10ae0c5e1 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/GroupedChildConfigurations.Serialization.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + public partial class GroupedChildConfigurations + { + internal static GroupedChildConfigurations DeserializeGroupedChildConfigurations(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional categoryInformation = default; + Optional> childConfigurations = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("categoryInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + categoryInformation = CategoryInformation.DeserializeCategoryInformation(property.Value); + continue; + } + if (property.NameEquals("childConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ChildConfiguration.DeserializeChildConfiguration(item)); + } + childConfigurations = array; + continue; + } + } + return new GroupedChildConfigurations(categoryInformation.Value, Optional.ToList(childConfigurations)); + } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/GroupedChildConfigurations.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/GroupedChildConfigurations.cs new file mode 100644 index 000000000000..3307a22a4f06 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/GroupedChildConfigurations.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + /// Grouped child configuration object. + public partial class GroupedChildConfigurations + { + /// Initializes a new instance of GroupedChildConfigurations. + internal GroupedChildConfigurations() + { + ChildConfigurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of GroupedChildConfigurations. + /// Category information. + /// List of child configurations. + internal GroupedChildConfigurations(CategoryInformation categoryInformation, IReadOnlyList childConfigurations) + { + CategoryInformation = categoryInformation; + ChildConfigurations = childConfigurations; + } + + /// Category information. + public CategoryInformation CategoryInformation { get; } + /// List of child configurations. + public IReadOnlyList ChildConfigurations { get; } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/IdentificationType.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/IdentificationType.cs new file mode 100644 index 000000000000..8844c25745bf --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/IdentificationType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + /// Identification type of the configuration. + public readonly partial struct IdentificationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IdentificationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotSupportedValue = "NotSupported"; + private const string SerialNumberValue = "SerialNumber"; + + /// Product does not have any explicit identifier. + public static IdentificationType NotSupported { get; } = new IdentificationType(NotSupportedValue); + /// Product is identifiable by serial number. + public static IdentificationType SerialNumber { get; } = new IdentificationType(SerialNumberValue); + /// Determines if two values are the same. + public static bool operator ==(IdentificationType left, IdentificationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IdentificationType left, IdentificationType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator IdentificationType(string value) => new IdentificationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IdentificationType other && Equals(other); + /// + public bool Equals(IdentificationType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/OrderItemResourceList.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/OrderItemResourceList.cs index aa00564c1487..9e29689e2c1b 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/OrderItemResourceList.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/OrderItemResourceList.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.EdgeOrder.Models { - /// List of orderItems. + /// List of order items. internal partial class OrderItemResourceList { /// Initializes a new instance of OrderItemResourceList. diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/OrderMode.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/OrderMode.cs new file mode 100644 index 000000000000..92bcb7d024c0 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/OrderMode.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.EdgeOrder.Models +{ + /// Defines the mode of the Order item. + public readonly partial struct OrderMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OrderMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string DoNotFulfillValue = "DoNotFulfill"; + + /// Default Order mode. + public static OrderMode Default { get; } = new OrderMode(DefaultValue); + /// Mode in which the Order will not be fulfilled. + public static OrderMode DoNotFulfill { get; } = new OrderMode(DoNotFulfillValue); + /// Determines if two values are the same. + public static bool operator ==(OrderMode left, OrderMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OrderMode left, OrderMode right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator OrderMode(string value) => new OrderMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OrderMode other && Equals(other); + /// + public bool Equals(OrderMode other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductAvailabilityInformation.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductAvailabilityInformation.cs index d1ece8ec85fc..a2cba449700f 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductAvailabilityInformation.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductAvailabilityInformation.cs @@ -16,7 +16,7 @@ internal ProductAvailabilityInformation() } /// Initializes a new instance of ProductAvailabilityInformation. - /// Current availability stage of the product. Availability stage. + /// Current availability stage of the product. /// Reason why the product is disabled. /// Message for why the product is disabled. internal ProductAvailabilityInformation(ProductAvailabilityStage? availabilityStage, ProductDisabledReason? disabledReason, string disabledReasonMessage) @@ -26,7 +26,7 @@ internal ProductAvailabilityInformation(ProductAvailabilityStage? availabilitySt DisabledReasonMessage = disabledReasonMessage; } - /// Current availability stage of the product. Availability stage. + /// Current availability stage of the product. public ProductAvailabilityStage? AvailabilityStage { get; } /// Reason why the product is disabled. public ProductDisabledReason? DisabledReason { get; } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductAvailabilityStage.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductAvailabilityStage.cs index 7f2bff0d8610..2907129fea58 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductAvailabilityStage.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductAvailabilityStage.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.EdgeOrder.Models { - /// Current availability stage of the product. Availability stage. + /// Current availability stage of the product. public readonly partial struct ProductAvailabilityStage : IEquatable { private readonly string _value; @@ -23,24 +23,27 @@ public ProductAvailabilityStage(string value) } private const string AvailableValue = "Available"; - private const string ComingSoonValue = "ComingSoon"; private const string PreviewValue = "Preview"; - private const string DeprecatedValue = "Deprecated"; private const string SignUpValue = "Signup"; + private const string DiscoverableValue = "Discoverable"; + private const string ComingSoonValue = "ComingSoon"; private const string UnavailableValue = "Unavailable"; + private const string DeprecatedValue = "Deprecated"; /// Product is available. public static ProductAvailabilityStage Available { get; } = new ProductAvailabilityStage(AvailableValue); - /// Product is coming soon. - public static ProductAvailabilityStage ComingSoon { get; } = new ProductAvailabilityStage(ComingSoonValue); /// Product is in preview. public static ProductAvailabilityStage Preview { get; } = new ProductAvailabilityStage(PreviewValue); - /// Product is deprecated. - public static ProductAvailabilityStage Deprecated { get; } = new ProductAvailabilityStage(DeprecatedValue); /// Product is available only on signup. public static ProductAvailabilityStage SignUp { get; } = new ProductAvailabilityStage(SignUpValue); + /// Product is not available in our service but can be discovered from other sources. + public static ProductAvailabilityStage Discoverable { get; } = new ProductAvailabilityStage(DiscoverableValue); + /// Product is coming soon. + public static ProductAvailabilityStage ComingSoon { get; } = new ProductAvailabilityStage(ComingSoonValue); /// Product is not available. public static ProductAvailabilityStage Unavailable { get; } = new ProductAvailabilityStage(UnavailableValue); + /// Product is deprecated. + public static ProductAvailabilityStage Deprecated { get; } = new ProductAvailabilityStage(DeprecatedValue); /// Determines if two values are the same. public static bool operator ==(ProductAvailabilityStage left, ProductAvailabilityStage right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductConfiguration.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductConfiguration.Serialization.cs index 9bd39af4e64e..d371d3fc5b81 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductConfiguration.Serialization.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductConfiguration.Serialization.cs @@ -25,9 +25,12 @@ internal static ProductConfiguration DeserializeProductConfiguration(JsonElement Optional costInformation = default; Optional availabilityInformation = default; Optional hierarchyInformation = default; + Optional fulfilledBy = default; Optional> filterableProperties = default; Optional> specifications = default; Optional dimensions = default; + Optional> childConfigurationTypes = default; + Optional> groupedChildConfigurations = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("properties"u8)) @@ -99,6 +102,16 @@ internal static ProductConfiguration DeserializeProductConfiguration(JsonElement hierarchyInformation = HierarchyInformation.DeserializeHierarchyInformation(property0.Value); continue; } + if (property0.NameEquals("fulfilledBy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + fulfilledBy = new FulfillmentType(property0.Value.GetString()); + continue; + } if (property0.NameEquals("filterableProperties"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -139,11 +152,41 @@ internal static ProductConfiguration DeserializeProductConfiguration(JsonElement dimensions = ProductDimensions.DeserializeProductDimensions(property0.Value); continue; } + if (property0.NameEquals("childConfigurationTypes"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(new ChildConfigurationType(item.GetString())); + } + childConfigurationTypes = array; + continue; + } + if (property0.NameEquals("groupedChildConfigurations"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(Models.GroupedChildConfigurations.DeserializeGroupedChildConfigurations(item)); + } + groupedChildConfigurations = array; + continue; + } } continue; } } - return new ProductConfiguration(displayName.Value, description.Value, Optional.ToList(imageInformation), costInformation.Value, availabilityInformation.Value, hierarchyInformation.Value, Optional.ToList(filterableProperties), Optional.ToList(specifications), dimensions.Value); + return new ProductConfiguration(displayName.Value, description.Value, Optional.ToList(imageInformation), costInformation.Value, availabilityInformation.Value, hierarchyInformation.Value, Optional.ToNullable(fulfilledBy), Optional.ToList(filterableProperties), Optional.ToList(specifications), dimensions.Value, Optional.ToList(childConfigurationTypes), Optional.ToList(groupedChildConfigurations)); } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductConfiguration.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductConfiguration.cs index bf1d27c4d566..0097bf5753ff 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductConfiguration.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductConfiguration.cs @@ -19,6 +19,8 @@ internal ProductConfiguration() ImageInformation = new ChangeTrackingList(); FilterableProperties = new ChangeTrackingList(); Specifications = new ChangeTrackingList(); + ChildConfigurationTypes = new ChangeTrackingList(); + GroupedChildConfigurations = new ChangeTrackingList(); } /// Initializes a new instance of ProductConfiguration. @@ -28,10 +30,13 @@ internal ProductConfiguration() /// Cost information for the product system. /// Availability information of the product system. /// Hierarchy information of a product. - /// list of filters supported for a product. + /// The entity responsible for fulfillment of the item at the given hierarchy level. + /// List of filters supported for a product. /// Specifications of the configuration. /// Dimensions of the configuration. - internal ProductConfiguration(string displayName, ProductDescription description, IReadOnlyList imageInformation, EdgeOrderProductCostInformation costInformation, ProductAvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, IReadOnlyList filterableProperties, IReadOnlyList specifications, ProductDimensions dimensions) + /// Different types of child configurations which exist for this configuration, these can be used to populate the child configuration filter. + /// Child configurations present for the configuration after applying child configuration filter, grouped by the category name of the child configuration. + internal ProductConfiguration(string displayName, ProductDescription description, IReadOnlyList imageInformation, EdgeOrderProductCostInformation costInformation, ProductAvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, FulfillmentType? fulfilledBy, IReadOnlyList filterableProperties, IReadOnlyList specifications, ProductDimensions dimensions, IReadOnlyList childConfigurationTypes, IReadOnlyList groupedChildConfigurations) { DisplayName = displayName; Description = description; @@ -39,9 +44,12 @@ internal ProductConfiguration(string displayName, ProductDescription description CostInformation = costInformation; AvailabilityInformation = availabilityInformation; HierarchyInformation = hierarchyInformation; + FulfilledBy = fulfilledBy; FilterableProperties = filterableProperties; Specifications = specifications; Dimensions = dimensions; + ChildConfigurationTypes = childConfigurationTypes; + GroupedChildConfigurations = groupedChildConfigurations; } /// Display Name for the product system. @@ -56,11 +64,17 @@ internal ProductConfiguration(string displayName, ProductDescription description public ProductAvailabilityInformation AvailabilityInformation { get; } /// Hierarchy information of a product. public HierarchyInformation HierarchyInformation { get; } - /// list of filters supported for a product. + /// The entity responsible for fulfillment of the item at the given hierarchy level. + public FulfillmentType? FulfilledBy { get; } + /// List of filters supported for a product. public IReadOnlyList FilterableProperties { get; } /// Specifications of the configuration. public IReadOnlyList Specifications { get; } /// Dimensions of the configuration. public ProductDimensions Dimensions { get; } + /// Different types of child configurations which exist for this configuration, these can be used to populate the child configuration filter. + public IReadOnlyList ChildConfigurationTypes { get; } + /// Child configurations present for the configuration after applying child configuration filter, grouped by the category name of the child configuration. + public IReadOnlyList GroupedChildConfigurations { get; } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductDetails.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductDetails.Serialization.cs index 97fb6d3a5d54..8dc6aac99ca1 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductDetails.Serialization.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductDetails.Serialization.cs @@ -23,6 +23,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WritePropertyName("hierarchyInformation"u8); writer.WriteObjectValue(HierarchyInformation); + if (Optional.IsCollectionDefined(OptInAdditionalConfigurations)) + { + writer.WritePropertyName("optInAdditionalConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in OptInAdditionalConfigurations) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } writer.WriteEndObject(); } @@ -34,9 +44,11 @@ internal static ProductDetails DeserializeProductDetails(JsonElement element) } Optional displayInfo = default; HierarchyInformation hierarchyInformation = default; - Optional count = default; Optional productDoubleEncryptionStatus = default; - Optional> deviceDetails = default; + Optional identificationType = default; + Optional parentDeviceDetails = default; + Optional> optInAdditionalConfigurations = default; + Optional> childConfigurationDeviceDetails = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("displayInfo"u8)) @@ -54,43 +66,68 @@ internal static ProductDetails DeserializeProductDetails(JsonElement element) hierarchyInformation = HierarchyInformation.DeserializeHierarchyInformation(property.Value); continue; } - if (property.NameEquals("count"u8)) + if (property.NameEquals("productDoubleEncryptionStatus"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - count = property.Value.GetInt32(); + productDoubleEncryptionStatus = new DoubleEncryptionStatus(property.Value.GetString()); continue; } - if (property.NameEquals("productDoubleEncryptionStatus"u8)) + if (property.NameEquals("identificationType"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - productDoubleEncryptionStatus = new DoubleEncryptionStatus(property.Value.GetString()); + identificationType = new IdentificationType(property.Value.GetString()); + continue; + } + if (property.NameEquals("parentDeviceDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + parentDeviceDetails = EdgeOrderProductDeviceDetails.DeserializeEdgeOrderProductDeviceDetails(property.Value); + continue; + } + if (property.NameEquals("optInAdditionalConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(AdditionalConfiguration.DeserializeAdditionalConfiguration(item)); + } + optInAdditionalConfigurations = array; continue; } - if (property.NameEquals("deviceDetails"u8)) + if (property.NameEquals("childConfigurationDeviceDetails"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) { property.ThrowNonNullablePropertyIsNull(); continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(EdgeOrderProductDeviceDetails.DeserializeEdgeOrderProductDeviceDetails(item)); + array.Add(ConfigurationDeviceDetails.DeserializeConfigurationDeviceDetails(item)); } - deviceDetails = array; + childConfigurationDeviceDetails = array; continue; } } - return new ProductDetails(displayInfo.Value, hierarchyInformation, Optional.ToNullable(count), Optional.ToNullable(productDoubleEncryptionStatus), Optional.ToList(deviceDetails)); + return new ProductDetails(displayInfo.Value, hierarchyInformation, Optional.ToNullable(productDoubleEncryptionStatus), Optional.ToNullable(identificationType), parentDeviceDetails.Value, Optional.ToList(optInAdditionalConfigurations), Optional.ToList(childConfigurationDeviceDetails)); } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductDetails.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductDetails.cs index 4902714c666f..c504a4a0ec60 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductDetails.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductDetails.cs @@ -22,33 +22,42 @@ public ProductDetails(HierarchyInformation hierarchyInformation) Argument.AssertNotNull(hierarchyInformation, nameof(hierarchyInformation)); HierarchyInformation = hierarchyInformation; - DeviceDetails = new ChangeTrackingList(); + OptInAdditionalConfigurations = new ChangeTrackingList(); + ChildConfigurationDeviceDetails = new ChangeTrackingList(); } /// Initializes a new instance of ProductDetails. /// Display details of the product. /// Hierarchy of the product which uniquely identifies the product. - /// Quantity of the product. /// Double encryption status of the configuration. Read-only field. - /// list of device details. - internal ProductDetails(ProductDisplayInfo displayInfo, HierarchyInformation hierarchyInformation, int? count, DoubleEncryptionStatus? productDoubleEncryptionStatus, IReadOnlyList deviceDetails) + /// Identification type of the configuration. + /// Device details of the parent configuration. + /// List of additional configurations customer wants in the order item apart from the ones included in the base configuration. + /// Details of all child configurations that are part of the order item. + internal ProductDetails(ProductDisplayInfo displayInfo, HierarchyInformation hierarchyInformation, DoubleEncryptionStatus? productDoubleEncryptionStatus, IdentificationType? identificationType, EdgeOrderProductDeviceDetails parentDeviceDetails, IList optInAdditionalConfigurations, IReadOnlyList childConfigurationDeviceDetails) { DisplayInfo = displayInfo; HierarchyInformation = hierarchyInformation; - Count = count; ProductDoubleEncryptionStatus = productDoubleEncryptionStatus; - DeviceDetails = deviceDetails; + IdentificationType = identificationType; + ParentDeviceDetails = parentDeviceDetails; + OptInAdditionalConfigurations = optInAdditionalConfigurations; + ChildConfigurationDeviceDetails = childConfigurationDeviceDetails; } /// Display details of the product. public ProductDisplayInfo DisplayInfo { get; set; } /// Hierarchy of the product which uniquely identifies the product. public HierarchyInformation HierarchyInformation { get; set; } - /// Quantity of the product. - public int? Count { get; } /// Double encryption status of the configuration. Read-only field. public DoubleEncryptionStatus? ProductDoubleEncryptionStatus { get; } - /// list of device details. - public IReadOnlyList DeviceDetails { get; } + /// Identification type of the configuration. + public IdentificationType? IdentificationType { get; } + /// Device details of the parent configuration. + public EdgeOrderProductDeviceDetails ParentDeviceDetails { get; } + /// List of additional configurations customer wants in the order item apart from the ones included in the base configuration. + public IList OptInAdditionalConfigurations { get; } + /// Details of all child configurations that are part of the order item. + public IReadOnlyList ChildConfigurationDeviceDetails { get; } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamiliesMetadata.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamiliesMetadata.Serialization.cs index 52ed33f71769..eff2d337a778 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamiliesMetadata.Serialization.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamiliesMetadata.Serialization.cs @@ -25,6 +25,7 @@ internal static ProductFamiliesMetadata DeserializeProductFamiliesMetadata(JsonE Optional costInformation = default; Optional availabilityInformation = default; Optional hierarchyInformation = default; + Optional fulfilledBy = default; Optional> filterableProperties = default; Optional> productLines = default; Optional> resourceProviderDetails = default; @@ -99,6 +100,16 @@ internal static ProductFamiliesMetadata DeserializeProductFamiliesMetadata(JsonE hierarchyInformation = HierarchyInformation.DeserializeHierarchyInformation(property0.Value); continue; } + if (property0.NameEquals("fulfilledBy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + fulfilledBy = new FulfillmentType(property0.Value.GetString()); + continue; + } if (property0.NameEquals("filterableProperties"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -148,7 +159,7 @@ internal static ProductFamiliesMetadata DeserializeProductFamiliesMetadata(JsonE continue; } } - return new ProductFamiliesMetadata(displayName.Value, description.Value, Optional.ToList(imageInformation), costInformation.Value, availabilityInformation.Value, hierarchyInformation.Value, Optional.ToList(filterableProperties), Optional.ToList(productLines), Optional.ToList(resourceProviderDetails)); + return new ProductFamiliesMetadata(displayName.Value, description.Value, Optional.ToList(imageInformation), costInformation.Value, availabilityInformation.Value, hierarchyInformation.Value, Optional.ToNullable(fulfilledBy), Optional.ToList(filterableProperties), Optional.ToList(productLines), Optional.ToList(resourceProviderDetails)); } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamiliesMetadata.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamiliesMetadata.cs index ec3f9247e744..158e917395a1 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamiliesMetadata.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamiliesMetadata.cs @@ -29,10 +29,11 @@ internal ProductFamiliesMetadata() /// Cost information for the product system. /// Availability information of the product system. /// Hierarchy information of a product. - /// list of filters supported for a product. + /// The entity responsible for fulfillment of the item at the given hierarchy level. + /// List of filters supported for a product. /// List of product lines supported in the product family. /// Contains details related to resource provider. - internal ProductFamiliesMetadata(string displayName, ProductDescription description, IReadOnlyList imageInformation, EdgeOrderProductCostInformation costInformation, ProductAvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, IReadOnlyList filterableProperties, IReadOnlyList productLines, IReadOnlyList resourceProviderDetails) + internal ProductFamiliesMetadata(string displayName, ProductDescription description, IReadOnlyList imageInformation, EdgeOrderProductCostInformation costInformation, ProductAvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, FulfillmentType? fulfilledBy, IReadOnlyList filterableProperties, IReadOnlyList productLines, IReadOnlyList resourceProviderDetails) { DisplayName = displayName; Description = description; @@ -40,6 +41,7 @@ internal ProductFamiliesMetadata(string displayName, ProductDescription descript CostInformation = costInformation; AvailabilityInformation = availabilityInformation; HierarchyInformation = hierarchyInformation; + FulfilledBy = fulfilledBy; FilterableProperties = filterableProperties; ProductLines = productLines; ResourceProviderDetails = resourceProviderDetails; @@ -57,7 +59,9 @@ internal ProductFamiliesMetadata(string displayName, ProductDescription descript public ProductAvailabilityInformation AvailabilityInformation { get; } /// Hierarchy information of a product. public HierarchyInformation HierarchyInformation { get; } - /// list of filters supported for a product. + /// The entity responsible for fulfillment of the item at the given hierarchy level. + public FulfillmentType? FulfilledBy { get; } + /// List of filters supported for a product. public IReadOnlyList FilterableProperties { get; } /// List of product lines supported in the product family. public IReadOnlyList ProductLines { get; } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamily.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamily.Serialization.cs index e2a7c959c0ae..2f1302619f94 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamily.Serialization.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamily.Serialization.cs @@ -25,6 +25,7 @@ internal static ProductFamily DeserializeProductFamily(JsonElement element) Optional costInformation = default; Optional availabilityInformation = default; Optional hierarchyInformation = default; + Optional fulfilledBy = default; Optional> filterableProperties = default; Optional> productLines = default; Optional> resourceProviderDetails = default; @@ -99,6 +100,16 @@ internal static ProductFamily DeserializeProductFamily(JsonElement element) hierarchyInformation = HierarchyInformation.DeserializeHierarchyInformation(property0.Value); continue; } + if (property0.NameEquals("fulfilledBy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + fulfilledBy = new FulfillmentType(property0.Value.GetString()); + continue; + } if (property0.NameEquals("filterableProperties"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -148,7 +159,7 @@ internal static ProductFamily DeserializeProductFamily(JsonElement element) continue; } } - return new ProductFamily(displayName.Value, description.Value, Optional.ToList(imageInformation), costInformation.Value, availabilityInformation.Value, hierarchyInformation.Value, Optional.ToList(filterableProperties), Optional.ToList(productLines), Optional.ToList(resourceProviderDetails)); + return new ProductFamily(displayName.Value, description.Value, Optional.ToList(imageInformation), costInformation.Value, availabilityInformation.Value, hierarchyInformation.Value, Optional.ToNullable(fulfilledBy), Optional.ToList(filterableProperties), Optional.ToList(productLines), Optional.ToList(resourceProviderDetails)); } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamily.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamily.cs index 664dd3a206fa..9e02072ca79d 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamily.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductFamily.cs @@ -29,10 +29,11 @@ internal ProductFamily() /// Cost information for the product system. /// Availability information of the product system. /// Hierarchy information of a product. - /// list of filters supported for a product. + /// The entity responsible for fulfillment of the item at the given hierarchy level. + /// List of filters supported for a product. /// List of product lines supported in the product family. /// Contains details related to resource provider. - internal ProductFamily(string displayName, ProductDescription description, IReadOnlyList imageInformation, EdgeOrderProductCostInformation costInformation, ProductAvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, IReadOnlyList filterableProperties, IReadOnlyList productLines, IReadOnlyList resourceProviderDetails) + internal ProductFamily(string displayName, ProductDescription description, IReadOnlyList imageInformation, EdgeOrderProductCostInformation costInformation, ProductAvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, FulfillmentType? fulfilledBy, IReadOnlyList filterableProperties, IReadOnlyList productLines, IReadOnlyList resourceProviderDetails) { DisplayName = displayName; Description = description; @@ -40,6 +41,7 @@ internal ProductFamily(string displayName, ProductDescription description, IRead CostInformation = costInformation; AvailabilityInformation = availabilityInformation; HierarchyInformation = hierarchyInformation; + FulfilledBy = fulfilledBy; FilterableProperties = filterableProperties; ProductLines = productLines; ResourceProviderDetails = resourceProviderDetails; @@ -57,7 +59,9 @@ internal ProductFamily(string displayName, ProductDescription description, IRead public ProductAvailabilityInformation AvailabilityInformation { get; } /// Hierarchy information of a product. public HierarchyInformation HierarchyInformation { get; } - /// list of filters supported for a product. + /// The entity responsible for fulfillment of the item at the given hierarchy level. + public FulfillmentType? FulfilledBy { get; } + /// List of filters supported for a product. public IReadOnlyList FilterableProperties { get; } /// List of product lines supported in the product family. public IReadOnlyList ProductLines { get; } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductLine.Serialization.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductLine.Serialization.cs index 0131b00d3553..f8125511824e 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductLine.Serialization.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductLine.Serialization.cs @@ -25,6 +25,7 @@ internal static ProductLine DeserializeProductLine(JsonElement element) Optional costInformation = default; Optional availabilityInformation = default; Optional hierarchyInformation = default; + Optional fulfilledBy = default; Optional> filterableProperties = default; Optional> products = default; foreach (var property in element.EnumerateObject()) @@ -98,6 +99,16 @@ internal static ProductLine DeserializeProductLine(JsonElement element) hierarchyInformation = HierarchyInformation.DeserializeHierarchyInformation(property0.Value); continue; } + if (property0.NameEquals("fulfilledBy"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + property0.ThrowNonNullablePropertyIsNull(); + continue; + } + fulfilledBy = new FulfillmentType(property0.Value.GetString()); + continue; + } if (property0.NameEquals("filterableProperties"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -132,7 +143,7 @@ internal static ProductLine DeserializeProductLine(JsonElement element) continue; } } - return new ProductLine(displayName.Value, description.Value, Optional.ToList(imageInformation), costInformation.Value, availabilityInformation.Value, hierarchyInformation.Value, Optional.ToList(filterableProperties), Optional.ToList(products)); + return new ProductLine(displayName.Value, description.Value, Optional.ToList(imageInformation), costInformation.Value, availabilityInformation.Value, hierarchyInformation.Value, Optional.ToNullable(fulfilledBy), Optional.ToList(filterableProperties), Optional.ToList(products)); } } } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductLine.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductLine.cs index 70065eee4be6..c4054da0f27d 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductLine.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductLine.cs @@ -28,9 +28,10 @@ internal ProductLine() /// Cost information for the product system. /// Availability information of the product system. /// Hierarchy information of a product. - /// list of filters supported for a product. + /// The entity responsible for fulfillment of the item at the given hierarchy level. + /// List of filters supported for a product. /// List of products in the product line. - internal ProductLine(string displayName, ProductDescription description, IReadOnlyList imageInformation, EdgeOrderProductCostInformation costInformation, ProductAvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, IReadOnlyList filterableProperties, IReadOnlyList products) + internal ProductLine(string displayName, ProductDescription description, IReadOnlyList imageInformation, EdgeOrderProductCostInformation costInformation, ProductAvailabilityInformation availabilityInformation, HierarchyInformation hierarchyInformation, FulfillmentType? fulfilledBy, IReadOnlyList filterableProperties, IReadOnlyList products) { DisplayName = displayName; Description = description; @@ -38,6 +39,7 @@ internal ProductLine(string displayName, ProductDescription description, IReadOn CostInformation = costInformation; AvailabilityInformation = availabilityInformation; HierarchyInformation = hierarchyInformation; + FulfilledBy = fulfilledBy; FilterableProperties = filterableProperties; Products = products; } @@ -54,7 +56,9 @@ internal ProductLine(string displayName, ProductDescription description, IReadOn public ProductAvailabilityInformation AvailabilityInformation { get; } /// Hierarchy information of a product. public HierarchyInformation HierarchyInformation { get; } - /// list of filters supported for a product. + /// The entity responsible for fulfillment of the item at the given hierarchy level. + public FulfillmentType? FulfilledBy { get; } + /// List of filters supported for a product. public IReadOnlyList FilterableProperties { get; } /// List of products in the product line. public IReadOnlyList Products { get; } diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductLinkType.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductLinkType.cs index af664e1f989e..0bf7cb14feff 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductLinkType.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductLinkType.cs @@ -28,6 +28,7 @@ public ProductLinkType(string value) private const string DocumentationValue = "Documentation"; private const string KnowMoreValue = "KnowMore"; private const string SignUpValue = "SignUp"; + private const string DiscoverableValue = "Discoverable"; /// Generic link. public static ProductLinkType Generic { get; } = new ProductLinkType(GenericValue); @@ -41,6 +42,8 @@ public ProductLinkType(string value) public static ProductLinkType KnowMore { get; } = new ProductLinkType(KnowMoreValue); /// Link to sign up for products. public static ProductLinkType SignUp { get; } = new ProductLinkType(SignUpValue); + /// Link to order the product from another source and not from Azure Edge Hardware Center. + public static ProductLinkType Discoverable { get; } = new ProductLinkType(DiscoverableValue); /// Determines if two values are the same. public static bool operator ==(ProductLinkType left, ProductLinkType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductSpecification.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductSpecification.cs index 70102b69ee05..01a07174fe58 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductSpecification.cs +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/Models/ProductSpecification.cs @@ -7,7 +7,7 @@ namespace Azure.ResourceManager.EdgeOrder.Models { - /// Specifications of the configurations. + /// Specification of the configurations. public partial class ProductSpecification { /// Initializes a new instance of ProductSpecification. diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/AddressesRestOperations.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/AddressesRestOperations.cs new file mode 100644 index 000000000000..6ffb4059237a --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/AddressesRestOperations.cs @@ -0,0 +1,690 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.EdgeOrder.Models; + +namespace Azure.ResourceManager.EdgeOrder +{ + internal partial class AddressesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of AddressesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public AddressesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2022-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string filter, string skipToken, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/addresses", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the addresses available under the subscription. + /// The ID of the target subscription. + /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. + /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, filter, skipToken, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AddressResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the addresses available under the subscription. + /// The ID of the target subscription. + /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. + /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, filter, skipToken, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AddressResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string filter, string skipToken, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/addresses", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the addresses available under the given resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. + /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, filter, skipToken, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AddressResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the addresses available under the given resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. + /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, filter, skipToken, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AddressResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string addressName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/addresses/", false); + uri.AppendPath(addressName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get information about the specified address. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string addressName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, addressName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EdgeOrderAddressData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EdgeOrderAddressData.DeserializeEdgeOrderAddressData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EdgeOrderAddressData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get information about the specified address. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string addressName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, addressName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EdgeOrderAddressData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EdgeOrderAddressData.DeserializeEdgeOrderAddressData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EdgeOrderAddressData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string addressName, EdgeOrderAddressData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/addresses/", false); + uri.AppendPath(addressName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// + /// Create a new address with the specified parameters. Existing address cannot be updated with this API and should + /// instead be updated with the Update address API. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + /// Address details from request body. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string addressName, EdgeOrderAddressData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, addressName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// + /// Create a new address with the specified parameters. Existing address cannot be updated with this API and should + /// instead be updated with the Update address API. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + /// Address details from request body. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string addressName, EdgeOrderAddressData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, addressName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string addressName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/addresses/", false); + uri.AppendPath(addressName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete an address. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string addressName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, addressName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete an address. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string addressName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, addressName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string addressName, EdgeOrderAddressPatch patch, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/addresses/", false); + uri.AppendPath(addressName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the properties of an existing address. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + /// Address update parameters from request body. + /// Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string addressName, EdgeOrderAddressPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, addressName, patch, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the properties of an existing address. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. + /// Address update parameters from request body. + /// Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string addressName, EdgeOrderAddressPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, addressName, patch, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string filter, string skipToken, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the addresses available under the subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. + /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, filter, skipToken, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AddressResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the addresses available under the subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. + /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, filter, skipToken, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AddressResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string filter, string skipToken, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the addresses available under the given resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. + /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, filter, skipToken, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + AddressResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the addresses available under the given resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. + /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string filter = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, filter, skipToken, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + AddressResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/EdgeOrderManagementRestOperations.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/EdgeOrderManagementRestOperations.cs deleted file mode 100644 index fa19dd00c0b3..000000000000 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/EdgeOrderManagementRestOperations.cs +++ /dev/null @@ -1,2319 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Text.Json; -using System.Threading; -using System.Threading.Tasks; -using Azure; -using Azure.Core; -using Azure.Core.Pipeline; -using Azure.ResourceManager.EdgeOrder.Models; - -namespace Azure.ResourceManager.EdgeOrder -{ - internal partial class EdgeOrderManagementRestOperations - { - private readonly TelemetryDetails _userAgent; - private readonly HttpPipeline _pipeline; - private readonly Uri _endpoint; - private readonly string _apiVersion; - - /// Initializes a new instance of EdgeOrderManagementRestOperations. - /// The HTTP pipeline for sending and receiving REST requests and responses. - /// The application id to use for user agent. - /// server parameter. - /// Api Version. - /// or is null. - public EdgeOrderManagementRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) - { - _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); - _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2021-12-01"; - _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); - } - - internal HttpMessage CreateListAddressesAtSubscriptionLevelRequest(string subscriptionId, string filter, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/addresses", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - if (skipToken != null) - { - uri.AppendQuery("$skipToken", skipToken, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the addresses available under the subscription. - /// The ID of the target subscription. - /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. - /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAddressesAtSubscriptionLevelAsync(string subscriptionId, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListAddressesAtSubscriptionLevelRequest(subscriptionId, filter, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AddressResourceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the addresses available under the subscription. - /// The ID of the target subscription. - /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. - /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListAddressesAtSubscriptionLevel(string subscriptionId, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListAddressesAtSubscriptionLevelRequest(subscriptionId, filter, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AddressResourceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProductFamiliesRequest(string subscriptionId, ProductFamiliesContent content, string expand, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/listProductFamilies", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (expand != null) - { - uri.AppendQuery("$expand", expand, true); - } - if (skipToken != null) - { - uri.AppendQuery("$skipToken", skipToken, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// This method provides the list of product families for the given subscription. - /// The ID of the target subscription. - /// Filters for showing the product families. - /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. - /// $skipToken is supported on list of product families, which provides the next page in the list of product families. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListProductFamiliesAsync(string subscriptionId, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateListProductFamiliesRequest(subscriptionId, content, expand, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProductFamilies value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProductFamilies.DeserializeProductFamilies(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method provides the list of product families for the given subscription. - /// The ID of the target subscription. - /// Filters for showing the product families. - /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. - /// $skipToken is supported on list of product families, which provides the next page in the list of product families. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListProductFamilies(string subscriptionId, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateListProductFamiliesRequest(subscriptionId, content, expand, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProductFamilies value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProductFamilies.DeserializeProductFamilies(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListConfigurationsRequest(string subscriptionId, ConfigurationsContent content, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/listConfigurations", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (skipToken != null) - { - uri.AppendQuery("$skipToken", skipToken, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// This method provides the list of configurations for the given product family, product line and product under subscription. - /// The ID of the target subscription. - /// Filters for showing the configurations. - /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListConfigurationsAsync(string subscriptionId, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateListConfigurationsRequest(subscriptionId, content, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProductConfigurations value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProductConfigurations.DeserializeProductConfigurations(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method provides the list of configurations for the given product family, product line and product under subscription. - /// The ID of the target subscription. - /// Filters for showing the configurations. - /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListConfigurations(string subscriptionId, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateListConfigurationsRequest(subscriptionId, content, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProductConfigurations value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProductConfigurations.DeserializeProductConfigurations(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProductFamiliesMetadataRequest(string subscriptionId, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/productFamiliesMetadata", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (skipToken != null) - { - uri.AppendQuery("$skipToken", skipToken, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method provides the list of product families metadata for the given subscription. - /// The ID of the target subscription. - /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListProductFamiliesMetadataAsync(string subscriptionId, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListProductFamiliesMetadataRequest(subscriptionId, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProductFamiliesMetadataListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProductFamiliesMetadataListResult.DeserializeProductFamiliesMetadataListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method provides the list of product families metadata for the given subscription. - /// The ID of the target subscription. - /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListProductFamiliesMetadata(string subscriptionId, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListProductFamiliesMetadataRequest(subscriptionId, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProductFamiliesMetadataListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProductFamiliesMetadataListResult.DeserializeProductFamiliesMetadataListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOrderAtSubscriptionLevelRequest(string subscriptionId, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/orders", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (skipToken != null) - { - uri.AppendQuery("$skipToken", skipToken, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists order at subscription level. - /// The ID of the target subscription. - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListOrderAtSubscriptionLevelAsync(string subscriptionId, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListOrderAtSubscriptionLevelRequest(subscriptionId, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OrderResourceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists order at subscription level. - /// The ID of the target subscription. - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListOrderAtSubscriptionLevel(string subscriptionId, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListOrderAtSubscriptionLevelRequest(subscriptionId, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OrderResourceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOrderItemsAtSubscriptionLevelRequest(string subscriptionId, string filter, string expand, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - if (expand != null) - { - uri.AppendQuery("$expand", expand, true); - } - if (skipToken != null) - { - uri.AppendQuery("$skipToken", skipToken, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists order item at subscription level. - /// The ID of the target subscription. - /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListOrderItemsAtSubscriptionLevelAsync(string subscriptionId, string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListOrderItemsAtSubscriptionLevelRequest(subscriptionId, filter, expand, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OrderItemResourceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists order item at subscription level. - /// The ID of the target subscription. - /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListOrderItemsAtSubscriptionLevel(string subscriptionId, string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListOrderItemsAtSubscriptionLevelRequest(subscriptionId, filter, expand, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OrderItemResourceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListAddressesAtResourceGroupLevelRequest(string subscriptionId, string resourceGroupName, string filter, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/addresses", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - if (skipToken != null) - { - uri.AppendQuery("$skipToken", skipToken, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the addresses available under the given resource group. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. - /// $skipToken is supported on Get list of addresses, which provides the next page in the list of address. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListAddressesAtResourceGroupLevelAsync(string subscriptionId, string resourceGroupName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListAddressesAtResourceGroupLevelRequest(subscriptionId, resourceGroupName, filter, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AddressResourceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the addresses available under the given resource group. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. - /// $skipToken is supported on Get list of addresses, which provides the next page in the list of address. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListAddressesAtResourceGroupLevel(string subscriptionId, string resourceGroupName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListAddressesAtResourceGroupLevelRequest(subscriptionId, resourceGroupName, filter, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AddressResourceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetAddressByNameRequest(string subscriptionId, string resourceGroupName, string addressName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/addresses/", false); - uri.AppendPath(addressName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets information about the specified address. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAddressByNameAsync(string subscriptionId, string resourceGroupName, string addressName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); - - using var message = CreateGetAddressByNameRequest(subscriptionId, resourceGroupName, addressName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - EdgeOrderAddressData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EdgeOrderAddressData.DeserializeEdgeOrderAddressData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((EdgeOrderAddressData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets information about the specified address. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response GetAddressByName(string subscriptionId, string resourceGroupName, string addressName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); - - using var message = CreateGetAddressByNameRequest(subscriptionId, resourceGroupName, addressName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - EdgeOrderAddressData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EdgeOrderAddressData.DeserializeEdgeOrderAddressData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((EdgeOrderAddressData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateAddressRequest(string subscriptionId, string resourceGroupName, string addressName, EdgeOrderAddressData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/addresses/", false); - uri.AppendPath(addressName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates a new address with the specified parameters. Existing address can be updated with this API. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// Address details from request body. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateAddressAsync(string subscriptionId, string resourceGroupName, string addressName, EdgeOrderAddressData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateAddressRequest(subscriptionId, resourceGroupName, addressName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates a new address with the specified parameters. Existing address can be updated with this API. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// Address details from request body. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateAddress(string subscriptionId, string resourceGroupName, string addressName, EdgeOrderAddressData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateAddressRequest(subscriptionId, resourceGroupName, addressName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteAddressByNameRequest(string subscriptionId, string resourceGroupName, string addressName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/addresses/", false); - uri.AppendPath(addressName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes an address. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAddressByNameAsync(string subscriptionId, string resourceGroupName, string addressName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); - - using var message = CreateDeleteAddressByNameRequest(subscriptionId, resourceGroupName, addressName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an address. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response DeleteAddressByName(string subscriptionId, string resourceGroupName, string addressName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); - - using var message = CreateDeleteAddressByNameRequest(subscriptionId, resourceGroupName, addressName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateAddressRequest(string subscriptionId, string resourceGroupName, string addressName, EdgeOrderAddressPatch patch, string ifMatch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/addresses/", false); - uri.AppendPath(addressName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - if (ifMatch != null) - { - request.Headers.Add("If-Match", ifMatch); - } - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates the properties of an existing address. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// Address update parameters from request body. - /// Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateAddressAsync(string subscriptionId, string resourceGroupName, string addressName, EdgeOrderAddressPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateAddressRequest(subscriptionId, resourceGroupName, addressName, patch, ifMatch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates the properties of an existing address. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the address Resource within the specified resource group. address names must be between 3 and 24 characters in length and use any alphanumeric and underscore only. - /// Address update parameters from request body. - /// Defines the If-Match condition. The patch will be performed only if the ETag of the job on the server matches this value. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response UpdateAddress(string subscriptionId, string resourceGroupName, string addressName, EdgeOrderAddressPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(addressName, nameof(addressName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateAddressRequest(subscriptionId, resourceGroupName, addressName, patch, ifMatch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOrderAtResourceGroupLevelRequest(string subscriptionId, string resourceGroupName, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/orders", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (skipToken != null) - { - uri.AppendQuery("$skipToken", skipToken, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists order at resource group level. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListOrderAtResourceGroupLevelAsync(string subscriptionId, string resourceGroupName, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListOrderAtResourceGroupLevelRequest(subscriptionId, resourceGroupName, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OrderResourceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists order at resource group level. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListOrderAtResourceGroupLevel(string subscriptionId, string resourceGroupName, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListOrderAtResourceGroupLevelRequest(subscriptionId, resourceGroupName, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OrderResourceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetOrderByNameRequest(string subscriptionId, string resourceGroupName, AzureLocation location, string orderName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/locations/", false); - uri.AppendPath(location, true); - uri.AppendPath("/orders/", false); - uri.AppendPath(orderName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets an order. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of Azure region. - /// The name of the order. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetOrderByNameAsync(string subscriptionId, string resourceGroupName, AzureLocation location, string orderName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderName, nameof(orderName)); - - using var message = CreateGetOrderByNameRequest(subscriptionId, resourceGroupName, location, orderName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - EdgeOrderData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EdgeOrderData.DeserializeEdgeOrderData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((EdgeOrderData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets an order. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of Azure region. - /// The name of the order. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response GetOrderByName(string subscriptionId, string resourceGroupName, AzureLocation location, string orderName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderName, nameof(orderName)); - - using var message = CreateGetOrderByNameRequest(subscriptionId, resourceGroupName, location, orderName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - EdgeOrderData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EdgeOrderData.DeserializeEdgeOrderData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((EdgeOrderData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOrderItemsAtResourceGroupLevelRequest(string subscriptionId, string resourceGroupName, string filter, string expand, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (filter != null) - { - uri.AppendQuery("$filter", filter, true); - } - if (expand != null) - { - uri.AppendQuery("$expand", expand, true); - } - if (skipToken != null) - { - uri.AppendQuery("$skipToken", skipToken, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists order item at resource group level. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListOrderItemsAtResourceGroupLevelAsync(string subscriptionId, string resourceGroupName, string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListOrderItemsAtResourceGroupLevelRequest(subscriptionId, resourceGroupName, filter, expand, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OrderItemResourceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists order item at resource group level. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListOrderItemsAtResourceGroupLevel(string subscriptionId, string resourceGroupName, string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListOrderItemsAtResourceGroupLevelRequest(subscriptionId, resourceGroupName, filter, expand, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OrderItemResourceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateGetOrderItemByNameRequest(string subscriptionId, string resourceGroupName, string orderItemName, string expand) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems/", false); - uri.AppendPath(orderItemName, true); - uri.AppendQuery("api-version", _apiVersion, true); - if (expand != null) - { - uri.AppendQuery("$expand", expand, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Gets an order item. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the order item. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetOrderItemByNameAsync(string subscriptionId, string resourceGroupName, string orderItemName, string expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - - using var message = CreateGetOrderItemByNameRequest(subscriptionId, resourceGroupName, orderItemName, expand); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - EdgeOrderItemData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = EdgeOrderItemData.DeserializeEdgeOrderItemData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((EdgeOrderItemData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - /// Gets an order item. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the order item. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response GetOrderItemByName(string subscriptionId, string resourceGroupName, string orderItemName, string expand = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - - using var message = CreateGetOrderItemByNameRequest(subscriptionId, resourceGroupName, orderItemName, expand); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - EdgeOrderItemData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = EdgeOrderItemData.DeserializeEdgeOrderItemData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((EdgeOrderItemData)null, message.Response); - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCreateOrderItemRequest(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemData data) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Put; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems/", false); - uri.AppendPath(orderItemName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(data); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item API. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the order item. - /// Order item details from request body. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrderItemAsync(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrderItemRequest(subscriptionId, resourceGroupName, orderItemName, data); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Creates an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item API. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the order item. - /// Order item details from request body. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrderItem(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemData data, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - Argument.AssertNotNull(data, nameof(data)); - - using var message = CreateCreateOrderItemRequest(subscriptionId, resourceGroupName, orderItemName, data); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateDeleteOrderItemByNameRequest(string subscriptionId, string resourceGroupName, string orderItemName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems/", false); - uri.AppendPath(orderItemName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Deletes an order item. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the order item. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteOrderItemByNameAsync(string subscriptionId, string resourceGroupName, string orderItemName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - - using var message = CreateDeleteOrderItemByNameRequest(subscriptionId, resourceGroupName, orderItemName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Deletes an order item. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the order item. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response DeleteOrderItemByName(string subscriptionId, string resourceGroupName, string orderItemName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - - using var message = CreateDeleteOrderItemByNameRequest(subscriptionId, resourceGroupName, orderItemName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateUpdateOrderItemRequest(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemPatch patch, string ifMatch) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Patch; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems/", false); - uri.AppendPath(orderItemName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - if (ifMatch != null) - { - request.Headers.Add("If-Match", ifMatch); - } - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(patch); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Updates the properties of an existing order item. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the order item. - /// order item update parameters from request body. - /// Defines the If-Match condition. The patch will be performed only if the ETag of the order on the server matches this value. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task UpdateOrderItemAsync(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateOrderItemRequest(subscriptionId, resourceGroupName, orderItemName, patch, ifMatch); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Updates the properties of an existing order item. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the order item. - /// order item update parameters from request body. - /// Defines the If-Match condition. The patch will be performed only if the ETag of the order on the server matches this value. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response UpdateOrderItem(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - Argument.AssertNotNull(patch, nameof(patch)); - - using var message = CreateUpdateOrderItemRequest(subscriptionId, resourceGroupName, orderItemName, patch, ifMatch); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateCancelOrderItemRequest(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemCancellationReason cancellationReason) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems/", false); - uri.AppendPath(orderItemName, true); - uri.AppendPath("/cancel", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content = new Utf8JsonRequestContent(); - content.JsonWriter.WriteObjectValue(cancellationReason); - request.Content = content; - _userAgent.Apply(message); - return message; - } - - /// Cancel order item. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the order item. - /// Reason for cancellation. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CancelOrderItemAsync(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemCancellationReason cancellationReason, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - Argument.AssertNotNull(cancellationReason, nameof(cancellationReason)); - - using var message = CreateCancelOrderItemRequest(subscriptionId, resourceGroupName, orderItemName, cancellationReason); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Cancel order item. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the order item. - /// Reason for cancellation. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response CancelOrderItem(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemCancellationReason cancellationReason, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - Argument.AssertNotNull(cancellationReason, nameof(cancellationReason)); - - using var message = CreateCancelOrderItemRequest(subscriptionId, resourceGroupName, orderItemName, cancellationReason); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 204: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateReturnOrderItemRequest(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemReturnContent content) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems/", false); - uri.AppendPath(orderItemName, true); - uri.AppendPath("/return", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content); - request.Content = content0; - _userAgent.Apply(message); - return message; - } - - /// Return order item. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the order item. - /// Return order item CurrentStatus. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task ReturnOrderItemAsync(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemReturnContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateReturnOrderItemRequest(subscriptionId, resourceGroupName, orderItemName, content); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Return order item. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// The name of the order item. - /// Return order item CurrentStatus. - /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ReturnOrderItem(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemReturnContent content, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateReturnOrderItemRequest(subscriptionId, resourceGroupName, orderItemName, content); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListAddressesAtSubscriptionLevelNextPageRequest(string nextLink, string subscriptionId, string filter, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the addresses available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. - /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAddressesAtSubscriptionLevelNextPageAsync(string nextLink, string subscriptionId, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListAddressesAtSubscriptionLevelNextPageRequest(nextLink, subscriptionId, filter, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AddressResourceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the addresses available under the subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. - /// $skipToken is supported on Get list of addresses, which provides the next page in the list of addresses. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListAddressesAtSubscriptionLevelNextPage(string nextLink, string subscriptionId, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListAddressesAtSubscriptionLevelNextPageRequest(nextLink, subscriptionId, filter, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AddressResourceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProductFamiliesNextPageRequest(string nextLink, string subscriptionId, ProductFamiliesContent content, string expand, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method provides the list of product families for the given subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// Filters for showing the product families. - /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. - /// $skipToken is supported on list of product families, which provides the next page in the list of product families. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListProductFamiliesNextPageAsync(string nextLink, string subscriptionId, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateListProductFamiliesNextPageRequest(nextLink, subscriptionId, content, expand, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProductFamilies value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProductFamilies.DeserializeProductFamilies(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method provides the list of product families for the given subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// Filters for showing the product families. - /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. - /// $skipToken is supported on list of product families, which provides the next page in the list of product families. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListProductFamiliesNextPage(string nextLink, string subscriptionId, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateListProductFamiliesNextPageRequest(nextLink, subscriptionId, content, expand, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProductFamilies value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProductFamilies.DeserializeProductFamilies(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListConfigurationsNextPageRequest(string nextLink, string subscriptionId, ConfigurationsContent content, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method provides the list of configurations for the given product family, product line and product under subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// Filters for showing the configurations. - /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListConfigurationsNextPageAsync(string nextLink, string subscriptionId, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateListConfigurationsNextPageRequest(nextLink, subscriptionId, content, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProductConfigurations value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProductConfigurations.DeserializeProductConfigurations(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method provides the list of configurations for the given product family, product line and product under subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// Filters for showing the configurations. - /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. - /// The cancellation token to use. - /// , or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListConfigurationsNextPage(string nextLink, string subscriptionId, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNull(content, nameof(content)); - - using var message = CreateListConfigurationsNextPageRequest(nextLink, subscriptionId, content, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProductConfigurations value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProductConfigurations.DeserializeProductConfigurations(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListProductFamiliesMetadataNextPageRequest(string nextLink, string subscriptionId, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// This method provides the list of product families metadata for the given subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListProductFamiliesMetadataNextPageAsync(string nextLink, string subscriptionId, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListProductFamiliesMetadataNextPageRequest(nextLink, subscriptionId, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ProductFamiliesMetadataListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = ProductFamiliesMetadataListResult.DeserializeProductFamiliesMetadataListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// This method provides the list of product families metadata for the given subscription. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListProductFamiliesMetadataNextPage(string nextLink, string subscriptionId, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListProductFamiliesMetadataNextPageRequest(nextLink, subscriptionId, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ProductFamiliesMetadataListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = ProductFamiliesMetadataListResult.DeserializeProductFamiliesMetadataListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOrderAtSubscriptionLevelNextPageRequest(string nextLink, string subscriptionId, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists order at subscription level. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListOrderAtSubscriptionLevelNextPageAsync(string nextLink, string subscriptionId, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListOrderAtSubscriptionLevelNextPageRequest(nextLink, subscriptionId, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OrderResourceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists order at subscription level. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListOrderAtSubscriptionLevelNextPage(string nextLink, string subscriptionId, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListOrderAtSubscriptionLevelNextPageRequest(nextLink, subscriptionId, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OrderResourceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOrderItemsAtSubscriptionLevelNextPageRequest(string nextLink, string subscriptionId, string filter, string expand, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists order item at subscription level. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListOrderItemsAtSubscriptionLevelNextPageAsync(string nextLink, string subscriptionId, string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListOrderItemsAtSubscriptionLevelNextPageRequest(nextLink, subscriptionId, filter, expand, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OrderItemResourceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists order item at subscription level. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. - /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListOrderItemsAtSubscriptionLevelNextPage(string nextLink, string subscriptionId, string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListOrderItemsAtSubscriptionLevelNextPageRequest(nextLink, subscriptionId, filter, expand, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OrderItemResourceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListAddressesAtResourceGroupLevelNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string filter, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists all the addresses available under the given resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. - /// $skipToken is supported on Get list of addresses, which provides the next page in the list of address. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListAddressesAtResourceGroupLevelNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListAddressesAtResourceGroupLevelNextPageRequest(nextLink, subscriptionId, resourceGroupName, filter, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - AddressResourceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists all the addresses available under the given resource group. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// $filter is supported to filter based on shipping address properties. Filter supports only equals operation. - /// $skipToken is supported on Get list of addresses, which provides the next page in the list of address. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListAddressesAtResourceGroupLevelNextPage(string nextLink, string subscriptionId, string resourceGroupName, string filter = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListAddressesAtResourceGroupLevelNextPageRequest(nextLink, subscriptionId, resourceGroupName, filter, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - AddressResourceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = AddressResourceList.DeserializeAddressResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOrderAtResourceGroupLevelNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists order at resource group level. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListOrderAtResourceGroupLevelNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListOrderAtResourceGroupLevelNextPageRequest(nextLink, subscriptionId, resourceGroupName, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OrderResourceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists order at resource group level. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// $skipToken is supported on Get list of order, which provides the next page in the list of order. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListOrderAtResourceGroupLevelNextPage(string nextLink, string subscriptionId, string resourceGroupName, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListOrderAtResourceGroupLevelNextPageRequest(nextLink, subscriptionId, resourceGroupName, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OrderResourceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal HttpMessage CreateListOrderItemsAtResourceGroupLevelNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string filter, string expand, string skipToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Lists order item at resource group level. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListOrderItemsAtResourceGroupLevelNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListOrderItemsAtResourceGroupLevelNextPageRequest(nextLink, subscriptionId, resourceGroupName, filter, expand, skipToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - OrderItemResourceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Lists order item at resource group level. - /// The URL to the next page of results. - /// The ID of the target subscription. - /// The name of the resource group. The name is case insensitive. - /// $filter is supported to filter based on order id. Filter supports only equals operation. - /// $expand is supported on device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Device Details for order item provides details on the devices of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. - /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. - /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListOrderItemsAtResourceGroupLevelNextPage(string nextLink, string subscriptionId, string resourceGroupName, string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNull(nextLink, nameof(nextLink)); - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListOrderItemsAtResourceGroupLevelNextPageRequest(nextLink, subscriptionId, resourceGroupName, filter, expand, skipToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - OrderItemResourceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - } -} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/OrderItemsRestOperations.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/OrderItemsRestOperations.cs new file mode 100644 index 000000000000..8352b64e064e --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/OrderItemsRestOperations.cs @@ -0,0 +1,870 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.EdgeOrder.Models; + +namespace Azure.ResourceManager.EdgeOrder +{ + internal partial class OrderItemsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of OrderItemsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public OrderItemsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2022-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string filter, string expand, string skipToken, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List order items at subscription level. + /// The ID of the target subscription. + /// $filter is supported to filter based on order id. Filter supports only equals operation. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, filter, expand, skipToken, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OrderItemResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List order items at subscription level. + /// The ID of the target subscription. + /// $filter is supported to filter based on order id. Filter supports only equals operation. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, filter, expand, skipToken, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OrderItemResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string filter, string expand, string skipToken, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List order items at resource group level. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// $filter is supported to filter based on order id. Filter supports only equals operation. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, filter, expand, skipToken, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OrderItemResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List order items at resource group level. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// $filter is supported to filter based on order id. Filter supports only equals operation. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, filter, expand, skipToken, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OrderItemResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string orderItemName, string expand) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems/", false); + uri.AppendPath(orderItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get an order item. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the order item. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string orderItemName, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, orderItemName, expand); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EdgeOrderItemData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EdgeOrderItemData.DeserializeEdgeOrderItemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EdgeOrderItemData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get an order item. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the order item. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string orderItemName, string expand = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, orderItemName, expand); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EdgeOrderItemData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EdgeOrderItemData.DeserializeEdgeOrderItemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EdgeOrderItemData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems/", false); + uri.AppendPath(orderItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// + /// Create an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item + /// API. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the order item. + /// Order item details from request body. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, orderItemName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// + /// Create an order item. Existing order item cannot be updated with this api and should instead be updated with the Update order item + /// API. + /// + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the order item. + /// Order item details from request body. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, orderItemName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string orderItemName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems/", false); + uri.AppendPath(orderItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete an order item. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the order item. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string orderItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, orderItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete an order item. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the order item. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string orderItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, orderItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemPatch patch, string ifMatch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems/", false); + uri.AppendPath(orderItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + if (ifMatch != null) + { + request.Headers.Add("If-Match", ifMatch); + } + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Update the properties of an existing order item. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the order item. + /// Order item update parameters from request body. + /// Defines the If-Match condition. The patch will be performed only if the ETag of the order on the server matches this value. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, orderItemName, patch, ifMatch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the properties of an existing order item. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the order item. + /// Order item update parameters from request body. + /// Defines the If-Match condition. The patch will be performed only if the ETag of the order on the server matches this value. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemPatch patch, string ifMatch = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, orderItemName, patch, ifMatch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemCancellationReason cancellationReason) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems/", false); + uri.AppendPath(orderItemName, true); + uri.AppendPath("/cancel", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(cancellationReason); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Cancel order item. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the order item. + /// Reason for cancellation. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CancelAsync(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemCancellationReason cancellationReason, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); + Argument.AssertNotNull(cancellationReason, nameof(cancellationReason)); + + using var message = CreateCancelRequest(subscriptionId, resourceGroupName, orderItemName, cancellationReason); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Cancel order item. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the order item. + /// Reason for cancellation. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Cancel(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemCancellationReason cancellationReason, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); + Argument.AssertNotNull(cancellationReason, nameof(cancellationReason)); + + using var message = CreateCancelRequest(subscriptionId, resourceGroupName, orderItemName, cancellationReason); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateReturnRequest(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemReturnContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/orderItems/", false); + uri.AppendPath(orderItemName, true); + uri.AppendPath("/return", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Return order item. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the order item. + /// Return order item details. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task ReturnAsync(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemReturnContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateReturnRequest(subscriptionId, resourceGroupName, orderItemName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Return order item. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the order item. + /// Return order item details. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Return(string subscriptionId, string resourceGroupName, string orderItemName, EdgeOrderItemReturnContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderItemName, nameof(orderItemName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateReturnRequest(subscriptionId, resourceGroupName, orderItemName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string filter, string expand, string skipToken, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List order items at subscription level. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// $filter is supported to filter based on order id. Filter supports only equals operation. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, filter, expand, skipToken, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OrderItemResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List order items at subscription level. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// $filter is supported to filter based on order id. Filter supports only equals operation. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, filter, expand, skipToken, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OrderItemResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string filter, string expand, string skipToken, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List order items at resource group level. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// $filter is supported to filter based on order id. Filter supports only equals operation. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, filter, expand, skipToken, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OrderItemResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List order items at resource group level. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// $filter is supported to filter based on order id. Filter supports only equals operation. + /// $expand is supported on parent device details, device details, forward shipping details and reverse shipping details parameters. Each of these can be provided as a comma separated list. Parent Device Details for order item provides details on the devices of the product, Device Details for order item provides details on the devices of the child configurations of the product, Forward and Reverse Shipping details provide forward and reverse shipping details respectively. + /// $skipToken is supported on Get list of order items, which provides the next page in the list of order items. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string filter = null, string expand = null, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, filter, expand, skipToken, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OrderItemResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OrderItemResourceList.DeserializeOrderItemResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/OrdersRestOperations.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/OrdersRestOperations.cs new file mode 100644 index 000000000000..0034131f0e69 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/OrdersRestOperations.cs @@ -0,0 +1,438 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.EdgeOrder.Models; + +namespace Azure.ResourceManager.EdgeOrder +{ + internal partial class OrdersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of OrdersRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public OrdersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2022-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId, string skipToken, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/orders", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List orders at subscription level. + /// The ID of the target subscription. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, skipToken, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OrderResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List orders at subscription level. + /// The ID of the target subscription. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId, skipToken, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OrderResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, AzureLocation location, string orderName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/orders/", false); + uri.AppendPath(orderName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get an order. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the order. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, AzureLocation location, string orderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderName, nameof(orderName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, location, orderName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EdgeOrderData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = EdgeOrderData.DeserializeEdgeOrderData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EdgeOrderData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get an order. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of Azure region. + /// The name of the order. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, AzureLocation location, string orderName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(orderName, nameof(orderName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, location, orderName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EdgeOrderData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = EdgeOrderData.DeserializeEdgeOrderData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EdgeOrderData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, string skipToken, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/orders", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List orders at resource group level. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skipToken, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OrderResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List orders at resource group level. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skipToken, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OrderResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId, string skipToken, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List orders at subscription level. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, skipToken, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OrderResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List orders at subscription level. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId, skipToken, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OrderResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string skipToken, int? top) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List orders at resource group level. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skipToken, top); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OrderResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List orders at resource group level. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// $skipToken is supported on Get list of orders, which provides the next page in the list of orders. + /// $top is supported on fetching list of resources. $top=10 means that the first 10 items in the list will be returned to the API caller. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, string skipToken = null, int? top = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName, skipToken, top); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OrderResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = OrderResourceList.DeserializeOrderResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/ProductsAndConfigurationsRestOperations.cs b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/ProductsAndConfigurationsRestOperations.cs new file mode 100644 index 000000000000..30e768b83af4 --- /dev/null +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Generated/RestOperations/ProductsAndConfigurationsRestOperations.cs @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.EdgeOrder.Models; + +namespace Azure.ResourceManager.EdgeOrder +{ + internal partial class ProductsAndConfigurationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ProductsAndConfigurationsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public ProductsAndConfigurationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2022-05-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListConfigurationsRequest(string subscriptionId, ConfigurationsContent content, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/listConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// List configurations for the given product family, product line and product for the given subscription. + /// The ID of the target subscription. + /// Filters for showing the configurations. + /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListConfigurationsAsync(string subscriptionId, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateListConfigurationsRequest(subscriptionId, content, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProductConfigurations value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProductConfigurations.DeserializeProductConfigurations(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List configurations for the given product family, product line and product for the given subscription. + /// The ID of the target subscription. + /// Filters for showing the configurations. + /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListConfigurations(string subscriptionId, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateListConfigurationsRequest(subscriptionId, content, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProductConfigurations value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProductConfigurations.DeserializeProductConfigurations(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProductFamiliesRequest(string subscriptionId, ProductFamiliesContent content, string expand, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/listProductFamilies", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (expand != null) + { + uri.AppendQuery("$expand", expand, true); + } + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// List product families for the given subscription. + /// The ID of the target subscription. + /// Filters for showing the product families. + /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. + /// $skipToken is supported on list of product families, which provides the next page in the list of product families. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListProductFamiliesAsync(string subscriptionId, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateListProductFamiliesRequest(subscriptionId, content, expand, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProductFamilies value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProductFamilies.DeserializeProductFamilies(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List product families for the given subscription. + /// The ID of the target subscription. + /// Filters for showing the product families. + /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. + /// $skipToken is supported on list of product families, which provides the next page in the list of product families. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListProductFamilies(string subscriptionId, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateListProductFamiliesRequest(subscriptionId, content, expand, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProductFamilies value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProductFamilies.DeserializeProductFamilies(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProductFamiliesMetadataRequest(string subscriptionId, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.EdgeOrder/productFamiliesMetadata", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skipToken != null) + { + uri.AppendQuery("$skipToken", skipToken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List product families metadata for the given subscription. + /// The ID of the target subscription. + /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListProductFamiliesMetadataAsync(string subscriptionId, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListProductFamiliesMetadataRequest(subscriptionId, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProductFamiliesMetadataListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProductFamiliesMetadataListResult.DeserializeProductFamiliesMetadataListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List product families metadata for the given subscription. + /// The ID of the target subscription. + /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListProductFamiliesMetadata(string subscriptionId, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListProductFamiliesMetadataRequest(subscriptionId, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProductFamiliesMetadataListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProductFamiliesMetadataListResult.DeserializeProductFamiliesMetadataListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConfigurationsNextPageRequest(string nextLink, string subscriptionId, ConfigurationsContent content, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List configurations for the given product family, product line and product for the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// Filters for showing the configurations. + /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListConfigurationsNextPageAsync(string nextLink, string subscriptionId, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateListConfigurationsNextPageRequest(nextLink, subscriptionId, content, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProductConfigurations value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProductConfigurations.DeserializeProductConfigurations(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List configurations for the given product family, product line and product for the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// Filters for showing the configurations. + /// $skipToken is supported on list of configurations, which provides the next page in the list of configurations. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListConfigurationsNextPage(string nextLink, string subscriptionId, ConfigurationsContent content, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateListConfigurationsNextPageRequest(nextLink, subscriptionId, content, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProductConfigurations value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProductConfigurations.DeserializeProductConfigurations(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProductFamiliesNextPageRequest(string nextLink, string subscriptionId, ProductFamiliesContent content, string expand, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List product families for the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// Filters for showing the product families. + /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. + /// $skipToken is supported on list of product families, which provides the next page in the list of product families. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListProductFamiliesNextPageAsync(string nextLink, string subscriptionId, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateListProductFamiliesNextPageRequest(nextLink, subscriptionId, content, expand, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProductFamilies value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProductFamilies.DeserializeProductFamilies(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List product families for the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// Filters for showing the product families. + /// $expand is supported on configurations parameter for product, which provides details on the configurations for the product. + /// $skipToken is supported on list of product families, which provides the next page in the list of product families. + /// The cancellation token to use. + /// , or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListProductFamiliesNextPage(string nextLink, string subscriptionId, ProductFamiliesContent content, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateListProductFamiliesNextPageRequest(nextLink, subscriptionId, content, expand, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProductFamilies value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProductFamilies.DeserializeProductFamilies(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListProductFamiliesMetadataNextPageRequest(string nextLink, string subscriptionId, string skipToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List product families metadata for the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListProductFamiliesMetadataNextPageAsync(string nextLink, string subscriptionId, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListProductFamiliesMetadataNextPageRequest(nextLink, subscriptionId, skipToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProductFamiliesMetadataListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ProductFamiliesMetadataListResult.DeserializeProductFamiliesMetadataListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List product families metadata for the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// $skipToken is supported on list of product families metadata, which provides the next page in the list of product families metadata. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListProductFamiliesMetadataNextPage(string nextLink, string subscriptionId, string skipToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListProductFamiliesMetadataNextPageRequest(nextLink, subscriptionId, skipToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProductFamiliesMetadataListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ProductFamiliesMetadataListResult.DeserializeProductFamiliesMetadataListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/autorest.md b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/autorest.md index 06f7fbde09bb..43f05208d508 100644 --- a/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/autorest.md +++ b/sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/autorest.md @@ -9,7 +9,7 @@ generate-model-factory: false csharp: true library-name: EdgeOrder namespace: Azure.ResourceManager.EdgeOrder -require: https://github.com/Azure/azure-rest-api-specs/blob/58891380ba22c3565ca884dee3831445f638b545/specification/edgeorder/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/edgeorder/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true