-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[TSP Migration][maintenance] TypeSpec migrated from swagger #34496
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
Merged
Merged
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
c509e7a
The first version of TSP
melina5656 624afa7
some fix
melina5656 50b1e62
Merge branch 'main' into convert/maintenance
melina5656 a415cfd
some fix
melina5656 58b591f
update
95f4bda
Some fixes
melina5656 3e07617
Delete oldSwagger.json
melina5656 a19e801
Update tspconfig.yaml
melina5656 5393039
Merge branch 'main' into convert/maintenance
melina5656 387d362
run prettier
melina5656 474df3b
run prettier and compile
melina5656 6739920
Merge branch 'main' into convert/maintenance
melina5656 cda524f
update
melina5656 c65de81
Merge branch 'main' into convert/maintenance
tadelesh d328132
Rename LegacyOperations to CustomLegacyOperations
melina5656 131b922
spell update
mcgallan 305c4ae
Merge branch 'main' into convert/maintenance
mcgallan b53121f
Merge branch 'main' into convert/maintenance
mcgallan 5baabb4
Delete conditionalClientFlatten
melina5656 e4ce23b
update
mcgallan b614731
update justification
melina5656 2c96355
Merge remote-tracking branch 'upstream/main' into convert/maintenance
mcgallan 041240e
update
mcgallan 72145c0
optimization for legacy operation
welovej 2549d02
update
mcgallan da3d2dc
Merge remote-tracking branch 'upstream/main' into convert/maintenance
mcgallan 45b2000
update
mcgallan 1060d47
update
6342574
update
8b81639
Merge branch 'main' into convert/maintenance
v-jiaodi eabd936
Merge branch 'main' into convert/maintenance
v-jiaodi 82c773f
resolve breaking change Deleted Class MaintenanceManagementClient
v-jiaodi 2ac553f
Merge branch 'main' into convert/maintenance
v-jiaodi 6e709ce
Update tspconfig.yaml
tadelesh 80cb1e1
update
50a9a4e
Merge branch 'convert/maintenance' of https://github.com/Azure/azure-…
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
154 changes: 154 additions & 0 deletions
154
specification/maintenance/Maintenance.Management/ApplyUpdate.tsp
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,154 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/openapi"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using TypeSpec.OpenAPI; | ||
|
|
||
| namespace Microsoft.Maintenance; | ||
| /** | ||
| * Apply Update request | ||
| */ | ||
| model ApplyUpdate | ||
| is Azure.ResourceManager.ProxyResource<ApplyUpdateProperties> { | ||
| ...ResourceNameParameter< | ||
| Resource = ApplyUpdate, | ||
| KeyName = "applyUpdateName", | ||
| SegmentName = "applyUpdates", | ||
| NamePattern = "" | ||
| >; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface ApplyUpdateOps | ||
| extends Azure.ResourceManager.Legacy.ExtensionOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...SubscriptionIdParameter, | ||
| ...ResourceGroupParameter, | ||
|
|
||
| /** | ||
| * Resource provider name | ||
| */ | ||
| @path | ||
| @key | ||
| @segment("providers") | ||
| providerName: string, | ||
|
|
||
| /** | ||
| * Resource parent type | ||
| */ | ||
| @path @key resourceParentType: string, | ||
|
|
||
| /** | ||
| * Resource parent name | ||
| */ | ||
| @path @key resourceParentName: string, | ||
|
|
||
| /** | ||
| * Resource type | ||
| */ | ||
| @path @key resourceType: string, | ||
|
|
||
| /** | ||
| * Resource name | ||
| */ | ||
| @path @key resourceName: string, | ||
| }, | ||
| {}, | ||
| { | ||
| ...Extension.ExtensionProviderNamespace<ApplyUpdate>, | ||
| ...KeysOf<ResourceNameParameter< | ||
| Resource = ApplyUpdate, | ||
| KeyName = "applyUpdateName", | ||
| SegmentName = "applyUpdates", | ||
| NamePattern = "" | ||
| >>, | ||
| } | ||
| > {} | ||
|
|
||
| @armResourceOperations | ||
| interface ApplyUpdates { | ||
| /** | ||
| * Track maintenance updates to resource with parent | ||
| */ | ||
| getParent is ApplyUpdateOps.Read<ApplyUpdate, ErrorType = MaintenanceError>; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface ApplyUpdateOperationGroupOps | ||
| extends Azure.ResourceManager.Legacy.ExtensionOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...SubscriptionIdParameter, | ||
| ...ResourceGroupParameter, | ||
|
|
||
| /** | ||
| * Resource provider name | ||
| */ | ||
| @path | ||
| @key | ||
| @segment("providers") | ||
| providerName: string, | ||
|
|
||
| /** | ||
| * Resource parent type | ||
| */ | ||
| @path @key resourceType: string, | ||
|
|
||
| /** | ||
| * Resource parent name | ||
| */ | ||
| @path @key resourceName: string, | ||
| }, | ||
| {}, | ||
| { | ||
| ...Extension.ExtensionProviderNamespace<ApplyUpdate>, | ||
| ...KeysOf<ResourceNameParameter< | ||
| Resource = ApplyUpdate, | ||
| KeyName = "applyUpdateName", | ||
| SegmentName = "applyUpdates", | ||
| NamePattern = "" | ||
| >>, | ||
| } | ||
| > {} | ||
|
|
||
| #suppress "@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @armResourceOperations | ||
| interface ApplyUpdateOperationGroup { | ||
| /** | ||
| * Track maintenance updates to resource | ||
| */ | ||
| get is ApplyUpdateOperationGroupOps.Read< | ||
| ApplyUpdate, | ||
| ErrorType = MaintenanceError | ||
| >; | ||
|
|
||
| /** | ||
| * Apply maintenance updates to resource | ||
| */ | ||
| createOrUpdateOrCancel is ApplyUpdateOperationGroupOps.CreateOrUpdateSync< | ||
| ApplyUpdate, | ||
| ErrorType = MaintenanceError | ||
| >; | ||
|
|
||
| /** | ||
| * Get Configuration records within a subscription | ||
| */ | ||
| list is Extension.ListByTarget< | ||
| Extension.Subscription, | ||
| ApplyUpdate, | ||
| Response = ArmResponse<ListApplyUpdate>, | ||
| Error = MaintenanceError | ||
| >; | ||
| } | ||
|
|
||
| @@doc(ApplyUpdate.name, "applyUpdate Id"); | ||
| @@doc(ApplyUpdate.properties, "Properties of the apply update"); | ||
| @@doc(ApplyUpdateOperationGroup.createOrUpdateOrCancel::parameters.resource, | ||
| "The ApplyUpdate" | ||
| ); | ||
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.