-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[DevCenter] SDK validation for TypeSpec swagger #52664
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
mzhongl524
wants to merge
14
commits into
Azure:main
Choose a base branch
from
mzhongl524:pr-devcenter
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 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1c1b109
Generate SDK code from Swagger
mzhongl524 5a50719
updated
mzhongl524 5ec0774
Regenerate SDK code and API after modifying the autorest file.
mzhongl524 3a48a73
updated
mzhongl524 41e86fe
fix ci issue
mzhongl524 60e78e6
temp updated
mzhongl524 df8bdcf
change Devcenter* to DevCenter*
mzhongl524 3bc99d5
fix rename
mzhongl524 28bf212
Regenerate SDK code after missing comments for parameters and model.
mzhongl524 e7f3dc6
updated
mzhongl524 982774f
updated
mzhongl524 abc7a62
updated log
mzhongl524 ca374ef
delete generated code and temp commit
mzhongl524 2e045db
Regenerate SDK code from Swagger
mzhongl524 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
1,806 changes: 1,732 additions & 74 deletions
1,806
sdk/devcenter/Azure.ResourceManager.DevCenter/api/Azure.ResourceManager.DevCenter.net8.0.cs
Large diffs are not rendered by default.
Oops, something went wrong.
1,806 changes: 1,732 additions & 74 deletions
1,806
...ter/Azure.ResourceManager.DevCenter/api/Azure.ResourceManager.DevCenter.netstandard2.0.cs
Large diffs are not rendered by default.
Oops, something went wrong.
190 changes: 190 additions & 0 deletions
190
sdk/devcenter/Azure.ResourceManager.DevCenter/src/Custom/ArmDevCenterModelFactory.cs
Large diffs are not rendered by default.
Oops, something went wrong.
79 changes: 79 additions & 0 deletions
79
sdk/devcenter/Azure.ResourceManager.DevCenter/src/Custom/DevCenterPoolResource.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,79 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
| using Azure.Core; | ||
|
|
||
| namespace Azure.ResourceManager.DevCenter | ||
| { | ||
| public partial class DevCenterPoolResource | ||
| { | ||
| /// <summary> | ||
| /// Gets a schedule resource. | ||
| /// <list type="bullet"> | ||
| /// <item> | ||
| /// <term>Request Path</term> | ||
| /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Operation Id</term> | ||
| /// <description>Schedules_Get</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Default Api Version</term> | ||
| /// <description>2023-04-01</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Resource</term> | ||
| /// <description><see cref="DevCenterScheduleResource"/></description> | ||
| /// </item> | ||
| /// </list> | ||
| /// </summary> | ||
| /// <param name="scheduleName"> The name of the schedule that uniquely identifies it. </param> | ||
| /// <param name="top"> The maximum number of resources to return from the operation. Example: '$top=10'. </param> | ||
| /// <param name="cancellationToken"> The cancellation token to use. </param> | ||
| /// <exception cref="ArgumentNullException"> <paramref name="scheduleName"/> is null. </exception> | ||
| /// <exception cref="ArgumentException"> <paramref name="scheduleName"/> is an empty string, and was expected to be non-empty. </exception> | ||
| [ForwardsClientCalls] | ||
| public virtual async Task<Response<DevCenterScheduleResource>> GetDevCenterScheduleAsync(string scheduleName, int? top = null, CancellationToken cancellationToken = default) | ||
| { | ||
| return await GetDevCenterScheduleAsync(scheduleName, cancellationToken).ConfigureAwait(false); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Gets a schedule resource. | ||
| /// <list type="bullet"> | ||
| /// <item> | ||
| /// <term>Request Path</term> | ||
| /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Operation Id</term> | ||
| /// <description>Schedules_Get</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Default Api Version</term> | ||
| /// <description>2023-04-01</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Resource</term> | ||
| /// <description><see cref="DevCenterScheduleResource"/></description> | ||
| /// </item> | ||
| /// </list> | ||
| /// </summary> | ||
| /// <param name="scheduleName"> The name of the schedule that uniquely identifies it. </param> | ||
| /// <param name="top"> The maximum number of resources to return from the operation. Example: '$top=10'. </param> | ||
| /// <param name="cancellationToken"> The cancellation token to use. </param> | ||
| /// <exception cref="ArgumentNullException"> <paramref name="scheduleName"/> is null. </exception> | ||
| /// <exception cref="ArgumentException"> <paramref name="scheduleName"/> is an empty string, and was expected to be non-empty. </exception> | ||
| [ForwardsClientCalls] | ||
| public virtual Response<DevCenterScheduleResource> GetDevCenterSchedule(string scheduleName, int? top = null, CancellationToken cancellationToken = default) | ||
mzhongl524 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| return GetDevCenterSchedule(scheduleName, cancellationToken); | ||
| } | ||
| } | ||
| } | ||
77 changes: 77 additions & 0 deletions
77
sdk/devcenter/Azure.ResourceManager.DevCenter/src/Custom/DevCenterResource.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,77 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System.Threading; | ||
| using Autorest.CSharp.Core; | ||
| using Azure.Core; | ||
|
|
||
| namespace Azure.ResourceManager.DevCenter | ||
| { | ||
| // Due to the breaking change that caused a change in the return type, the method name has been renamed and the required method for the API has been added back. | ||
| public partial class DevCenterResource | ||
| { | ||
| /// <summary> | ||
| /// Lists images for a devcenter. | ||
| /// <list type="bullet"> | ||
| /// <item> | ||
| /// <term>Request Path</term> | ||
| /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/images</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Operation Id</term> | ||
| /// <description>Images_ListByDevCenter</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Default Api Version</term> | ||
| /// <description>2023-04-01</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Resource</term> | ||
| /// <description><see cref="DevCenterImageResource"/></description> | ||
| /// </item> | ||
| /// </list> | ||
| /// </summary> | ||
| /// <param name="top"> The maximum number of resources to return from the operation. Example: '$top=10'. </param> | ||
| /// <param name="cancellationToken"> The cancellation token to use. </param> | ||
| /// <returns> An async collection of <see cref="DevCenterImageResource"/> that may take multiple service requests to iterate over. </returns> | ||
| public virtual AsyncPageable<DevCenterImageResource> GetImagesAsync(int? top = null, CancellationToken cancellationToken = default) | ||
mzhongl524 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| HttpMessage FirstPageRequest(int? pageSizeHint) => _imagesRestClient.CreateListByDevCenterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, top); | ||
| HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _imagesRestClient.CreateListByDevCenterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, top); | ||
| return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DevCenterImageResource(Client, DevCenterImageData.DeserializeDevCenterImageData(e)), _imagesClientDiagnostics, Pipeline, "DevCenterResource.GetImages", "value", "nextLink", cancellationToken); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Lists images for a devcenter. | ||
| /// <list type="bullet"> | ||
| /// <item> | ||
| /// <term>Request Path</term> | ||
| /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}/images</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Operation Id</term> | ||
| /// <description>Images_ListByDevCenter</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Default Api Version</term> | ||
| /// <description>2023-04-01</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Resource</term> | ||
| /// <description><see cref="DevCenterImageResource"/></description> | ||
| /// </item> | ||
| /// </list> | ||
| /// </summary> | ||
| /// <param name="top"> The maximum number of resources to return from the operation. Example: '$top=10'. </param> | ||
| /// <param name="cancellationToken"> The cancellation token to use. </param> | ||
| /// <returns> A collection of <see cref="DevCenterImageResource"/> that may take multiple service requests to iterate over. </returns> | ||
| public virtual Pageable<DevCenterImageResource> GetImages(int? top = null, CancellationToken cancellationToken = default) | ||
| { | ||
| HttpMessage FirstPageRequest(int? pageSizeHint) => _imagesRestClient.CreateListByDevCenterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, top); | ||
| HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _imagesRestClient.CreateListByDevCenterNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, top); | ||
| return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DevCenterImageResource(Client, DevCenterImageData.DeserializeDevCenterImageData(e)), _imagesClientDiagnostics, Pipeline, "DevCenterResource.GetImages", "value", "nextLink", cancellationToken); | ||
| } | ||
| } | ||
| } | ||
200 changes: 200 additions & 0 deletions
200
sdk/devcenter/Azure.ResourceManager.DevCenter/src/Custom/DevCenterScheduleCollection.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,200 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| #nullable disable | ||
|
|
||
| using System; | ||
| using System.Threading; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace Azure.ResourceManager.DevCenter | ||
| { | ||
| public partial class DevCenterScheduleCollection | ||
| { | ||
| /// <summary> | ||
| /// Gets a schedule resource. | ||
| /// <list type="bullet"> | ||
| /// <item> | ||
| /// <term>Request Path</term> | ||
| /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Operation Id</term> | ||
| /// <description>Schedules_Get</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Default Api Version</term> | ||
| /// <description>2023-04-01</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Resource</term> | ||
| /// <description><see cref="DevCenterScheduleResource"/></description> | ||
| /// </item> | ||
| /// </list> | ||
| /// </summary> | ||
| /// <param name="scheduleName"> The name of the schedule that uniquely identifies it. </param> | ||
| /// <param name="top"> The maximum number of resources to return from the operation. Example: '$top=10'. </param> | ||
| /// <param name="cancellationToken"> The cancellation token to use. </param> | ||
| /// <exception cref="ArgumentException"> <paramref name="scheduleName"/> is an empty string, and was expected to be non-empty. </exception> | ||
| /// <exception cref="ArgumentNullException"> <paramref name="scheduleName"/> is null. </exception> | ||
| public virtual async Task<Response<DevCenterScheduleResource>> GetAsync(string scheduleName, int? top, CancellationToken cancellationToken = default) | ||
mzhongl524 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| { | ||
| return await GetAsync(scheduleName, cancellationToken).ConfigureAwait(false); | ||
| } | ||
ArcturusZhang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| /// <summary> | ||
| /// Gets a schedule resource. | ||
| /// <list type="bullet"> | ||
| /// <item> | ||
| /// <term>Request Path</term> | ||
| /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Operation Id</term> | ||
| /// <description>Schedules_Get</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Default Api Version</term> | ||
| /// <description>2023-04-01</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Resource</term> | ||
| /// <description><see cref="DevCenterScheduleResource"/></description> | ||
| /// </item> | ||
| /// </list> | ||
| /// </summary> | ||
| /// <param name="scheduleName"> The name of the schedule that uniquely identifies it. </param> | ||
| /// <param name="top"> The maximum number of resources to return from the operation. Example: '$top=10'. </param> | ||
| /// <param name="cancellationToken"> The cancellation token to use. </param> | ||
| /// <exception cref="ArgumentException"> <paramref name="scheduleName"/> is an empty string, and was expected to be non-empty. </exception> | ||
| /// <exception cref="ArgumentNullException"> <paramref name="scheduleName"/> is null. </exception> | ||
| public virtual Response<DevCenterScheduleResource> Get(string scheduleName, int? top, CancellationToken cancellationToken = default) | ||
| { | ||
| return Get(scheduleName, cancellationToken); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Checks to see if the resource exists in azure. | ||
| /// <list type="bullet"> | ||
| /// <item> | ||
| /// <term>Request Path</term> | ||
| /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Operation Id</term> | ||
| /// <description>Schedules_Get</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Default Api Version</term> | ||
| /// <description>2023-04-01</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Resource</term> | ||
| /// <description><see cref="DevCenterScheduleResource"/></description> | ||
| /// </item> | ||
| /// </list> | ||
| /// </summary> | ||
| /// <param name="scheduleName"> The name of the schedule that uniquely identifies it. </param> | ||
| /// <param name="top"> The maximum number of resources to return from the operation. Example: '$top=10'. </param> | ||
| /// <param name="cancellationToken"> The cancellation token to use. </param> | ||
| /// <exception cref="ArgumentException"> <paramref name="scheduleName"/> is an empty string, and was expected to be non-empty. </exception> | ||
| /// <exception cref="ArgumentNullException"> <paramref name="scheduleName"/> is null. </exception> | ||
| public virtual async Task<Response<bool>> ExistsAsync(string scheduleName, int? top, CancellationToken cancellationToken = default) | ||
| { | ||
| return await ExistsAsync(scheduleName, cancellationToken).ConfigureAwait(false); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Checks to see if the resource exists in azure. | ||
| /// <list type="bullet"> | ||
| /// <item> | ||
| /// <term>Request Path</term> | ||
| /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Operation Id</term> | ||
| /// <description>Schedules_Get</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Default Api Version</term> | ||
| /// <description>2023-04-01</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Resource</term> | ||
| /// <description><see cref="DevCenterScheduleResource"/></description> | ||
| /// </item> | ||
| /// </list> | ||
| /// </summary> | ||
| /// <param name="scheduleName"> The name of the schedule that uniquely identifies it. </param> | ||
| /// <param name="top"> The maximum number of resources to return from the operation. Example: '$top=10'. </param> | ||
| /// <param name="cancellationToken"> The cancellation token to use. </param> | ||
| /// <exception cref="ArgumentException"> <paramref name="scheduleName"/> is an empty string, and was expected to be non-empty. </exception> | ||
| /// <exception cref="ArgumentNullException"> <paramref name="scheduleName"/> is null. </exception> | ||
| public virtual Response<bool> Exists(string scheduleName, int? top, CancellationToken cancellationToken = default) | ||
| { | ||
| return Exists(scheduleName, cancellationToken); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Tries to get details for this resource from the service. | ||
| /// <list type="bullet"> | ||
| /// <item> | ||
| /// <term>Request Path</term> | ||
| /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Operation Id</term> | ||
| /// <description>Schedules_Get</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Default Api Version</term> | ||
| /// <description>2023-04-01</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Resource</term> | ||
| /// <description><see cref="DevCenterScheduleResource"/></description> | ||
| /// </item> | ||
| /// </list> | ||
| /// </summary> | ||
| /// <param name="scheduleName"> The name of the schedule that uniquely identifies it. </param> | ||
| /// <param name="top"> The maximum number of resources to return from the operation. Example: '$top=10'. </param> | ||
| /// <param name="cancellationToken"> The cancellation token to use. </param> | ||
| /// <exception cref="ArgumentException"> <paramref name="scheduleName"/> is an empty string, and was expected to be non-empty. </exception> | ||
| /// <exception cref="ArgumentNullException"> <paramref name="scheduleName"/> is null. </exception> | ||
| public virtual async Task<NullableResponse<DevCenterScheduleResource>> GetIfExistsAsync(string scheduleName, int? top, CancellationToken cancellationToken = default) | ||
| { | ||
| return await GetIfExistsAsync(scheduleName, cancellationToken).ConfigureAwait(false); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Tries to get details for this resource from the service. | ||
| /// <list type="bullet"> | ||
| /// <item> | ||
| /// <term>Request Path</term> | ||
| /// <description>/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/projects/{projectName}/pools/{poolName}/schedules/{scheduleName}</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Operation Id</term> | ||
| /// <description>Schedules_Get</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Default Api Version</term> | ||
| /// <description>2023-04-01</description> | ||
| /// </item> | ||
| /// <item> | ||
| /// <term>Resource</term> | ||
| /// <description><see cref="DevCenterScheduleResource"/></description> | ||
| /// </item> | ||
| /// </list> | ||
| /// </summary> | ||
| /// <param name="scheduleName"> The name of the schedule that uniquely identifies it. </param> | ||
| /// <param name="top"> The maximum number of resources to return from the operation. Example: '$top=10'. </param> | ||
| /// <param name="cancellationToken"> The cancellation token to use. </param> | ||
| /// <exception cref="ArgumentException"> <paramref name="scheduleName"/> is an empty string, and was expected to be non-empty. </exception> | ||
| /// <exception cref="ArgumentNullException"> <paramref name="scheduleName"/> is null. </exception> | ||
| public virtual NullableResponse<DevCenterScheduleResource> GetIfExists(string scheduleName, int? top, CancellationToken cancellationToken = default) | ||
| { | ||
| return GetIfExists(scheduleName, cancellationToken); | ||
| } | ||
| } | ||
| } | ||
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.