-
Notifications
You must be signed in to change notification settings - Fork 5k
[EdgeOrder] SDK validation for TypeSpec #51790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
HarveyLink
wants to merge
17
commits into
Azure:main
Choose a base branch
from
HarveyLink:v-minghc-edgeorder
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
63987c1
Regen for TSP
HarveyLink 4d72989
Fix current
HarveyLink c88cdda
regen
HarveyLink e6200c9
Update tsp-location.yaml
HarveyLink f04c640
Fix others
HarveyLink d8703f9
fix flatten model
HarveyLink 1b5daae
Fix create response type
HarveyLink 2281da5
regen
HarveyLink c5ff01e
Fix tests
HarveyLink 91a1a19
Update tsp-location.yaml
HarveyLink 2f9c155
update api
HarveyLink 6ee52f3
Add comment
HarveyLink b3dc36a
Merge remote-tracking branch 'upstream/main' into v-minghc-edgeorder
HarveyLink a2192a4
Polish
HarveyLink 6831d97
Update tsp-location.yaml
HarveyLink fd04ab0
Merge remote-tracking branch 'upstream/main' into v-minghc-edgeorder
HarveyLink ae87f8e
Update assets.json
HarveyLink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
63 changes: 63 additions & 0 deletions
63
sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Custom/ArmEdgeOrderModelFactory.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Linq; | ||
using Azure.Core; | ||
using Azure.ResourceManager.Models; | ||
|
||
namespace Azure.ResourceManager.EdgeOrder.Models | ||
{ | ||
public static partial class ArmEdgeOrderModelFactory | ||
{ | ||
/// <summary> Initializes a new instance of <see cref="Models.EdgeOrderItemDetails"/>. </summary> | ||
/// <param name="productDetails"> Unique identifier for configuration. </param> | ||
/// <param name="orderItemType"> Order item type. </param> | ||
/// <param name="currentStage"> Current Order item Status. </param> | ||
/// <param name="orderItemStageHistory"> Order item status history. </param> | ||
/// <param name="preferences"> Customer notification Preferences. </param> | ||
/// <param name="forwardShippingDetails"> Forward Package Shipping details. </param> | ||
/// <param name="reverseShippingDetails"> Reverse Package Shipping details. </param> | ||
/// <param name="notificationEmailList"> Additional notification email list. </param> | ||
/// <param name="cancellationReason"> Cancellation reason. </param> | ||
/// <param name="cancellationStatus"> Describes whether the order item is cancellable or not. </param> | ||
/// <param name="deletionStatus"> Describes whether the order item is deletable or not. </param> | ||
/// <param name="returnReason"> Return reason. </param> | ||
/// <param name="returnStatus"> Describes whether the order item is returnable or not. </param> | ||
/// <param name="firstOrDefaultManagementResourceProviderNamespace"> Parent RP details - this returns only the first or default parent RP from the entire list. </param> | ||
/// <param name="managementRPDetailsList"> List of parent RP details supported for configuration. </param> | ||
/// <param name="error"> Top level error for the job. </param> | ||
/// <returns> A new <see cref="Models.EdgeOrderItemDetails"/> instance for mocking. </returns> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public static EdgeOrderItemDetails EdgeOrderItemDetails(ProductDetails productDetails = null, OrderItemType orderItemType = default, EdgeOrderStageDetails currentStage = null, IEnumerable<EdgeOrderStageDetails> orderItemStageHistory = null, OrderItemPreferences preferences = null, ForwardShippingDetails forwardShippingDetails = null, ReverseShippingDetails reverseShippingDetails = null, IEnumerable<string> notificationEmailList = null, string cancellationReason = null, OrderItemCancellationStatus? cancellationStatus = null, EdgeOrderActionStatus? deletionStatus = null, string returnReason = null, OrderItemReturnStatus? returnStatus = null, string firstOrDefaultManagementResourceProviderNamespace = null, IEnumerable<ResourceProviderDetails> managementRPDetailsList = null, ResponseError error = null) | ||
{ | ||
orderItemStageHistory ??= new List<EdgeOrderStageDetails>(); | ||
notificationEmailList ??= new List<string>(); | ||
managementRPDetailsList ??= new List<ResourceProviderDetails>(); | ||
|
||
return new EdgeOrderItemDetails( | ||
productDetails, | ||
orderItemType, | ||
null, | ||
null, | ||
currentStage, | ||
orderItemStageHistory?.ToList(), | ||
preferences, | ||
forwardShippingDetails, | ||
reverseShippingDetails, | ||
notificationEmailList?.ToList(), | ||
cancellationReason, | ||
cancellationStatus, | ||
deletionStatus, | ||
returnReason, | ||
returnStatus, | ||
managementRPDetailsList?.ToList(), | ||
error, | ||
serializedAdditionalRawData: null); | ||
} | ||
} | ||
} |
102 changes: 102 additions & 0 deletions
102
sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Custom/EdgeOrderAddressCollection.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Globalization; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Autorest.CSharp.Core; | ||
using Azure.Core; | ||
using Azure.Core.Pipeline; | ||
using Azure.ResourceManager.Resources; | ||
|
||
[assembly: CodeGenSuppressType(nameof(IEnumerator))] | ||
[assembly: CodeGenSuppressType(nameof(IEnumerator<Azure.ResourceManager.EdgeOrder.EdgeOrderAddressResource>))] | ||
[assembly: CodeGenSuppressType(nameof(IAsyncEnumerator<Azure.ResourceManager.EdgeOrder.EdgeOrderAddressResource>))] | ||
namespace Azure.ResourceManager.EdgeOrder | ||
{ | ||
public partial class EdgeOrderAddressCollection | ||
{ | ||
/// <summary> | ||
/// Lists all the addresses available under the given resource group. | ||
/// <list type="bullet"> | ||
/// <item> | ||
/// <term>Request Path</term> | ||
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses</description> | ||
/// </item> | ||
/// <item> | ||
/// <term>Operation Id</term> | ||
/// <description>ListAddressesAtResourceGroupLevel</description> | ||
/// </item> | ||
/// <item> | ||
/// <term>Default Api Version</term> | ||
/// <description>2021-12-01</description> | ||
/// </item> | ||
/// <item> | ||
/// <term>Resource</term> | ||
/// <description><see cref="EdgeOrderAddressResource"/></description> | ||
/// </item> | ||
/// </list> | ||
/// </summary> | ||
/// <param name="filter"> $filter is supported to filter based on shipping address properties. Filter supports only equals operation. </param> | ||
/// <param name="skipToken"> $skipToken is supported on Get list of addresses, which provides the next page in the list of address. </param> | ||
/// <param name="cancellationToken"> The cancellation token to use. </param> | ||
/// <returns> An async collection of <see cref="EdgeOrderAddressResource"/> that may take multiple service requests to iterate over. </returns> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public virtual AsyncPageable<EdgeOrderAddressResource> GetAllAsync(string filter = null, string skipToken = null, CancellationToken cancellationToken = default) | ||
{ | ||
return GetAllAsync(filter, skipToken, null, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// Lists all the addresses available under the given resource group. | ||
/// <list type="bullet"> | ||
/// <item> | ||
/// <term>Request Path</term> | ||
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/addresses</description> | ||
/// </item> | ||
/// <item> | ||
/// <term>Operation Id</term> | ||
/// <description>ListAddressesAtResourceGroupLevel</description> | ||
/// </item> | ||
/// <item> | ||
/// <term>Default Api Version</term> | ||
/// <description>2021-12-01</description> | ||
/// </item> | ||
/// <item> | ||
/// <term>Resource</term> | ||
/// <description><see cref="EdgeOrderAddressResource"/></description> | ||
/// </item> | ||
/// </list> | ||
/// </summary> | ||
/// <param name="filter"> $filter is supported to filter based on shipping address properties. Filter supports only equals operation. </param> | ||
/// <param name="skipToken"> $skipToken is supported on Get list of addresses, which provides the next page in the list of address. </param> | ||
/// <param name="cancellationToken"> The cancellation token to use. </param> | ||
/// <returns> A collection of <see cref="EdgeOrderAddressResource"/> that may take multiple service requests to iterate over. </returns> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public virtual Pageable<EdgeOrderAddressResource> GetAll(string filter = null, string skipToken = null, CancellationToken cancellationToken = default) | ||
{ | ||
return GetAll(filter, skipToken, null, cancellationToken); | ||
} | ||
|
||
IEnumerator<EdgeOrderAddressResource> IEnumerable<EdgeOrderAddressResource>.GetEnumerator() | ||
{ | ||
return GetAll(null, null, null).GetEnumerator(); | ||
} | ||
|
||
IEnumerator IEnumerable.GetEnumerator() | ||
{ | ||
return GetAll(null, null, null).GetEnumerator(); | ||
} | ||
|
||
IAsyncEnumerator<EdgeOrderAddressResource> IAsyncEnumerable<EdgeOrderAddressResource>.GetAsyncEnumerator(CancellationToken cancellationToken) | ||
{ | ||
return GetAllAsync(null, null, cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Custom/EdgeOrderAddressData.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Azure.Core; | ||
using Azure.ResourceManager.EdgeOrder.Models; | ||
using Azure.ResourceManager.Models; | ||
|
||
namespace Azure.ResourceManager.EdgeOrder | ||
{ | ||
public partial class EdgeOrderAddressData | ||
{ | ||
/// <summary> Initializes a new instance of <see cref="EdgeOrderAddressData"/>. </summary> | ||
/// <param name="location"> The location. </param> | ||
/// <param name="contactDetails"> Contact details for the address. </param> | ||
/// <exception cref="ArgumentNullException"> <paramref name="contactDetails"/> is null. </exception> | ||
public EdgeOrderAddressData(AzureLocation location, EdgeOrderAddressContactDetails contactDetails) : base(location) | ||
{ | ||
Argument.AssertNotNull(contactDetails, nameof(contactDetails)); | ||
|
||
ContactDetails = contactDetails; | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Custom/EdgeOrderData.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using Azure.Core; | ||
using Azure.ResourceManager.EdgeOrder.Models; | ||
using Azure.ResourceManager.Models; | ||
|
||
namespace Azure.ResourceManager.EdgeOrder | ||
{ | ||
public partial class EdgeOrderData | ||
{ | ||
/// <summary> Initializes a new instance of <see cref="EdgeOrderData"/>. </summary> | ||
public EdgeOrderData() | ||
{ | ||
OrderStageHistory = new ChangeTrackingList<EdgeOrderStageDetails>(); | ||
} | ||
} | ||
} |
104 changes: 104 additions & 0 deletions
104
sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Custom/EdgeOrderItemCollection.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Globalization; | ||
using System.Threading; | ||
using System.Threading.Tasks; | ||
using Autorest.CSharp.Core; | ||
using Azure.Core; | ||
using Azure.Core.Pipeline; | ||
using Azure.ResourceManager.Resources; | ||
|
||
[assembly: CodeGenSuppressType(nameof(IEnumerator))] | ||
HarveyLink marked this conversation as resolved.
Show resolved
Hide resolved
|
||
[assembly: CodeGenSuppressType(nameof(IEnumerator<Azure.ResourceManager.EdgeOrder.EdgeOrderItemResource>))] | ||
[assembly: CodeGenSuppressType(nameof(IAsyncEnumerator<Azure.ResourceManager.EdgeOrder.EdgeOrderItemResource>))] | ||
namespace Azure.ResourceManager.EdgeOrder | ||
{ | ||
public partial class EdgeOrderItemCollection | ||
{ | ||
/// <summary> | ||
/// Lists order item at resource group level. | ||
/// <list type="bullet"> | ||
/// <item> | ||
/// <term>Request Path</term> | ||
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems</description> | ||
/// </item> | ||
/// <item> | ||
/// <term>Operation Id</term> | ||
/// <description>ListOrderItemsAtResourceGroupLevel</description> | ||
/// </item> | ||
/// <item> | ||
/// <term>Default Api Version</term> | ||
/// <description>2021-12-01</description> | ||
/// </item> | ||
/// <item> | ||
/// <term>Resource</term> | ||
/// <description><see cref="EdgeOrderItemResource"/></description> | ||
/// </item> | ||
/// </list> | ||
/// </summary> | ||
/// <param name="filter"> $filter is supported to filter based on order id. Filter supports only equals operation. </param> | ||
/// <param name="expand"> $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. </param> | ||
/// <param name="skipToken"> $skipToken is supported on Get list of order items, which provides the next page in the list of order items. </param> | ||
/// <param name="cancellationToken"> The cancellation token to use. </param> | ||
/// <returns> An async collection of <see cref="EdgeOrderItemResource"/> that may take multiple service requests to iterate over. </returns> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public virtual AsyncPageable<EdgeOrderItemResource> GetAllAsync(string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) | ||
{ | ||
return GetAllAsync(filter, expand, skipToken, null, cancellationToken); | ||
} | ||
|
||
/// <summary> | ||
/// Lists order item at resource group level. | ||
/// <list type="bullet"> | ||
/// <item> | ||
/// <term>Request Path</term> | ||
/// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EdgeOrder/orderItems</description> | ||
/// </item> | ||
/// <item> | ||
/// <term>Operation Id</term> | ||
/// <description>ListOrderItemsAtResourceGroupLevel</description> | ||
/// </item> | ||
/// <item> | ||
/// <term>Default Api Version</term> | ||
/// <description>2021-12-01</description> | ||
/// </item> | ||
/// <item> | ||
/// <term>Resource</term> | ||
/// <description><see cref="EdgeOrderItemResource"/></description> | ||
/// </item> | ||
/// </list> | ||
/// </summary> | ||
/// <param name="filter"> $filter is supported to filter based on order id. Filter supports only equals operation. </param> | ||
/// <param name="expand"> $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. </param> | ||
/// <param name="skipToken"> $skipToken is supported on Get list of order items, which provides the next page in the list of order items. </param> | ||
/// <param name="cancellationToken"> The cancellation token to use. </param> | ||
/// <returns> A collection of <see cref="EdgeOrderItemResource"/> that may take multiple service requests to iterate over. </returns> | ||
[EditorBrowsable(EditorBrowsableState.Never)] | ||
public virtual Pageable<EdgeOrderItemResource> GetAll(string filter = null, string expand = null, string skipToken = null, CancellationToken cancellationToken = default) | ||
{ | ||
return GetAll(filter, expand, skipToken, null, cancellationToken); | ||
} | ||
|
||
IEnumerator<EdgeOrderItemResource> IEnumerable<EdgeOrderItemResource>.GetEnumerator() | ||
{ | ||
return GetAll(null, null, null, null).GetEnumerator(); | ||
} | ||
|
||
IEnumerator IEnumerable.GetEnumerator() | ||
{ | ||
return GetAll(null, null, null, null).GetEnumerator(); | ||
} | ||
|
||
IAsyncEnumerator<EdgeOrderItemResource> IAsyncEnumerable<EdgeOrderItemResource>.GetAsyncEnumerator(CancellationToken cancellationToken) | ||
{ | ||
return GetAllAsync(null, null, null, cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
sdk/edgeorder/Azure.ResourceManager.EdgeOrder/src/Custom/EdgeOrderItemData.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
#nullable disable | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using Azure.Core; | ||
using Azure.ResourceManager.EdgeOrder.Models; | ||
using Azure.ResourceManager.Models; | ||
|
||
namespace Azure.ResourceManager.EdgeOrder | ||
{ | ||
public partial class EdgeOrderItemData | ||
{ | ||
/// <summary> Initializes a new instance of <see cref="EdgeOrderItemData"/>. </summary> | ||
/// <param name="location"> The location. </param> | ||
/// <param name="orderItemDetails"> Represents order item details. </param> | ||
/// <param name="addressDetails"> Represents shipping and return address for order item. </param> | ||
/// <param name="orderId"> Id of the order to which order item belongs to. </param> | ||
/// <exception cref="ArgumentNullException"> <paramref name="orderItemDetails"/>, <paramref name="addressDetails"/> or <paramref name="orderId"/> is null. </exception> | ||
public EdgeOrderItemData(AzureLocation location, EdgeOrderItemDetails orderItemDetails, EdgeOrderItemAddressDetails addressDetails, ResourceIdentifier orderId) : base(location) | ||
{ | ||
Argument.AssertNotNull(orderItemDetails, nameof(orderItemDetails)); | ||
Argument.AssertNotNull(addressDetails, nameof(addressDetails)); | ||
Argument.AssertNotNull(orderId, nameof(orderId)); | ||
|
||
OrderItemDetails = orderItemDetails; | ||
AddressDetails = addressDetails; | ||
OrderId = orderId; | ||
} | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.