-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Review request v3 for Microsoft.Portal to onboard to TypeSpec (#29796)
* Initial iteration: Exact copy of 2020-09-01-preview * Iteration#2: Adding the typespec * Reoved 2022-12-01preview api * Modified example files * Removed old files * Added tsp output * Reverted readme * Added new tsp project * Separated tenant config * Renamed configuration model name * Made changes to swagger * Fixed operation id * Renamed configuration properties * Renamed resource in body * Moved ConfigurationName union * Added back 404 * Revert "Added back 404" This reverts commit 36fb5e0. * Tenant Config set to singleton * Revert "Tenant Config set to singleton" This reverts commit 2ab8012. * Reapply "Added back 404" This reverts commit 0e83bb4. * Reverted 404 and singleton * Moving to v3 * Removed pattern from DashboardName * DashboardPartMetaData type to string * Added additional properties * Revert "Added additional properties" This reverts commit 01f9f32. * Revert "DashboardPartMetaData type to string" This reverts commit 575e290. * Revert "Moving to v3" This reverts commit a734912. * Revert "Reverted 404 and singleton" This reverts commit 862eafe. * Reapply "Reverted 404 and singleton" This reverts commit 43e5c42. * Revert "Added back 404" This reverts commit 36fb5e0. * Modified examples * Fixed examples * prettier * Removed the default segment name * Removed unncessary sections * Added common lib among * New line added * Revert "New line added" This reverts commit 683cab7. * Revert "Added common lib among" This reverts commit 6ddbd38. * Removed operation from Tenant config * Removed unnecessary operation list --------- Co-authored-by: Sayeed Alam <saalam@microsoft.com>
- Loading branch information
1 parent
3f3d26f
commit 38865af
Showing
37 changed files
with
2,198 additions
and
823 deletions.
There are no files selected for viewing
This file contains 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,74 @@ | ||
import "@azure-tools/typespec-azure-core"; | ||
import "@azure-tools/typespec-azure-resource-manager"; | ||
import "@azure-tools/typespec-client-generator-core"; | ||
import "@typespec/openapi"; | ||
import "@typespec/rest"; | ||
import "./models.tsp"; | ||
|
||
using Azure.ClientGenerator.Core; | ||
using Azure.ResourceManager; | ||
using TypeSpec.Http; | ||
using TypeSpec.OpenAPI; | ||
using TypeSpec.Rest; | ||
|
||
namespace Microsoft.Portal; | ||
/** | ||
* The shared dashboard resource definition. | ||
*/ | ||
@doc("The shared dashboard resource definition.") | ||
model Dashboard | ||
is Azure.ResourceManager.TrackedResource<DashboardPropertiesWithProvisioningState> { | ||
...ResourceNameParameter<Resource = Dashboard>; | ||
} | ||
|
||
@armResourceOperations | ||
interface Dashboards { | ||
/** | ||
* Gets the Dashboard. | ||
*/ | ||
get is ArmResourceRead<Dashboard>; | ||
|
||
/** | ||
* Creates or updates a Dashboard. | ||
*/ | ||
createOrUpdate is ArmResourceCreateOrReplaceSync<Dashboard>; | ||
|
||
/** | ||
* Updates an existing Dashboard. | ||
*/ | ||
@parameterVisibility | ||
update is ArmCustomPatchSync<Dashboard, PatchableDashboard>; | ||
|
||
/** | ||
* Deletes the Dashboard. | ||
*/ | ||
delete is ArmResourceDeleteSync<Dashboard>; | ||
|
||
/** | ||
* Gets all the Dashboards within a resource group. | ||
*/ | ||
listByResourceGroup is ArmResourceListByParent<Dashboard>; | ||
|
||
/** | ||
* Gets all the dashboards within a subscription. | ||
*/ | ||
listBySubscription is ArmListBySubscription<Dashboard>; | ||
} | ||
|
||
@@maxLength(Dashboard.name, 64); | ||
@@minLength(Dashboard.name, 3); | ||
@@doc(Dashboard.name, "The name of the dashboard."); | ||
@@doc(Dashboards.createOrUpdate::parameters.resource, | ||
"The parameters required to create or update a dashboard." | ||
); | ||
@@doc(Dashboards.update::parameters.properties, | ||
"The updatable fields of a Dashboard." | ||
); | ||
@@encodedName(Dashboards.createOrUpdate::parameters.resource, | ||
"application/json", | ||
"dashboard" | ||
); | ||
@@encodedName(Dashboards.update::parameters.properties, | ||
"application/json", | ||
"dashboard" | ||
); |
This file contains 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,8 @@ | ||
import "./main.tsp"; | ||
import "@azure-tools/typespec-client-generator-core"; | ||
|
||
using Azure.ClientGenerator.Core; | ||
using Microsoft.Portal; | ||
|
||
#suppress "deprecated" "@flattenProperty decorator is not recommended to use." | ||
@@flattenProperty(PatchableDashboard.properties); |
This file contains 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
6 changes: 4 additions & 2 deletions
6
...-01-preview/examples/deleteDashboard.json → ...2020-09-01-preview/Dashboards_Delete.json
This file contains 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 |
---|---|---|
@@ -1,12 +1,14 @@ | ||
{ | ||
"parameters": { | ||
"api-version": "2020-09-01-preview", | ||
"dashboardName": "testDashboard", | ||
"resourceGroupName": "testRG", | ||
"api-version": "2020-09-01-preview", | ||
"subscriptionId": "00000000-0000-0000-0000-000000000000" | ||
}, | ||
"responses": { | ||
"200": {}, | ||
"204": {} | ||
} | ||
}, | ||
"operationId": "Dashboards_Delete", | ||
"title": "Delete a Dashboard" | ||
} |
This file contains 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
Oops, something went wrong.