-
Notifications
You must be signed in to change notification settings - Fork 5.6k
[Support] tsp migration #35579
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
[Support] tsp migration #35579
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit
Hold shift + click to select a range
659b969
update default tag
msyyc a7a5598
init tsp
msyyc 9d8108a
init swagger
msyyc 8566e0b
add suppression for warning
msyyc 59da501
fix body name
msyyc 96596d7
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
msyyc 9ec86ab
fix breaking
msyyc dff4286
Fix for nextlink
msyyc ad1ea07
fix for return type name of list operations
msyyc 090f90c
fix body name
msyyc ce61871
fix for azure-async-operation
msyyc ab70921
fix for azure-async-operation
msyyc 578b0bf
fix for azure-async-operation
msyyc 99cc2e2
fix for azure-async-operation
msyyc cc88fd1
temp files
msyyc 9328072
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
msyyc 645ee1d
add @clientLocation and remove @operationId
msyyc da42cd5
use @clientLocation to replace @operationId
msyyc 1409802
format
msyyc b696007
format
msyyc a19f2a9
format
msyyc 3499da9
fix Swagger ModelValidation error INVALID_FORMAT
msyyc 0b43f3d
make value optional to keep compatibility with swagger
msyyc a417d0a
add tspconfig.yaml
msyyc 757a378
Merge branches 'support-tsp-migration' and 'main' of https://github.c…
msyyc 27988b1
customize for no body common op
msyyc 0af7957
customize for no body common op
msyyc d6a4027
format
msyyc 49482f1
fix cspell
msyyc 802f21f
fix ci
msyyc f82ec3e
fix ci
msyyc 70d938b
fix ci
msyyc 4780d61
resolve breaking
v-jiaodi e99085a
Merge branch 'main' into support-tsp-migration
msyyc a161443
update for empty union
msyyc f6cbc25
fix missing final result for lro
msyyc cde9cd3
Merge branch 'main' into support-tsp-migration
msyyc 810e3af
update for @pageItems
msyyc 0a009ef
Merge branch 'main' into support-tsp-migration
msyyc 4611ffc
Merge branch 'main' into support-tsp-migration
msyyc c8d94de
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
msyyc 4e01375
fix for pattern
msyyc bd75919
Merge branch 'main' into support-tsp-migration
msyyc 3331035
Merge branch 'main' into support-tsp-migration
msyyc 8d17a36
service-name
weidongxu-microsoft 237112e
Merge branch 'main' into support-tsp-migration
v-jiaodi 61848f9
remove legacy operation
3fcbcdb
Add emit-lro-options: "all"
melina5656 9edc306
remove csharp config
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
init tsp
- Loading branch information
commit a7a55989a2ba7104423f9aaf0808addb5d8ddc9a
There are no files selected for viewing
97 changes: 97 additions & 0 deletions
97
specification/support/Support.Management/ChatTranscriptDetails.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,97 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/openapi"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
| import "./SupportTicketDetails.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using TypeSpec.OpenAPI; | ||
|
|
||
| namespace Microsoft.Support; | ||
| /** | ||
| * Object that represents a Chat Transcript resource. | ||
| */ | ||
| @parentResource(SupportTicketDetails) | ||
| model ChatTranscriptDetails | ||
| is Azure.ResourceManager.ProxyResource<ChatTranscriptDetailsProperties> { | ||
| ...ResourceNameParameter< | ||
| Resource = ChatTranscriptDetails, | ||
| KeyName = "chatTranscriptName", | ||
| SegmentName = "chatTranscripts", | ||
| NamePattern = "" | ||
| >; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface ChatTranscriptOps | ||
| extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...SubscriptionIdParameter, | ||
| ...Azure.ResourceManager.Legacy.Provider, | ||
| ...KeysOf<ResourceNameParameter< | ||
| Resource = SupportTicketDetails, | ||
| KeyName = "supportTicketName", | ||
| SegmentName = "supportTickets", | ||
| NamePattern = "" | ||
| >>, | ||
| }, | ||
| KeysOf<ResourceNameParameter< | ||
| Resource = ChatTranscriptDetails, | ||
| KeyName = "chatTranscriptName", | ||
| SegmentName = "chatTranscripts", | ||
| NamePattern = "" | ||
| >> | ||
| > {} | ||
|
|
||
| @armResourceOperations | ||
| interface ChatTranscripts { | ||
| /** | ||
| * Returns chatTranscript details for a support ticket under a subscription. | ||
| */ | ||
| get is ChatTranscriptOps.Read<ChatTranscriptDetails>; | ||
|
|
||
| /** | ||
| * Lists all chat transcripts for a support ticket under subscription | ||
| */ | ||
| list is ChatTranscriptOps.List<ChatTranscriptDetails>; | ||
| } | ||
| @armResourceOperations | ||
| interface ChatTranscriptsNoSubscriptionOps | ||
| extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...Azure.ResourceManager.Legacy.Provider, | ||
| ...KeysOf<ResourceNameParameter< | ||
| Resource = SupportTicketDetails, | ||
| KeyName = "supportTicketName", | ||
| SegmentName = "supportTickets", | ||
| NamePattern = "" | ||
| >>, | ||
| }, | ||
| KeysOf<ResourceNameParameter< | ||
| Resource = ChatTranscriptDetails, | ||
| KeyName = "chatTranscriptName", | ||
| SegmentName = "chatTranscripts", | ||
| NamePattern = "" | ||
| >> | ||
| > {} | ||
|
|
||
| @armResourceOperations | ||
| interface ChatTranscriptsNoSubscription { | ||
| /** | ||
| * Returns chatTranscript details for a no subscription support ticket. | ||
| */ | ||
| get is ChatTranscriptsNoSubscriptionOps.Read<ChatTranscriptDetails>; | ||
|
|
||
| /** | ||
| * Lists all chat transcripts for a support ticket | ||
| */ | ||
| list is ChatTranscriptsNoSubscriptionOps.List<ChatTranscriptDetails>; | ||
| } | ||
|
|
||
| @@doc(ChatTranscriptDetails.name, "ChatTranscript name."); | ||
| @@doc(ChatTranscriptDetails.properties, "Properties of the resource."); |
152 changes: 152 additions & 0 deletions
152
specification/support/Support.Management/CommunicationDetails.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,152 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/openapi"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
| import "./SupportTicketDetails.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using TypeSpec.OpenAPI; | ||
|
|
||
| namespace Microsoft.Support; | ||
| /** | ||
| * Object that represents a Communication resource. | ||
| */ | ||
| @parentResource(SupportTicketDetails) | ||
| model CommunicationDetails | ||
| is Azure.ResourceManager.ProxyResource< | ||
| CommunicationDetailsProperties, | ||
| false | ||
| > { | ||
| ...ResourceNameParameter< | ||
| Resource = CommunicationDetails, | ||
| KeyName = "communicationName", | ||
| SegmentName = "communications", | ||
| NamePattern = "" | ||
| >; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface CommunicationOps | ||
| extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...SubscriptionIdParameter, | ||
| ...Azure.ResourceManager.Legacy.Provider, | ||
| ...KeysOf<ResourceNameParameter< | ||
| Resource = SupportTicketDetails, | ||
| KeyName = "supportTicketName", | ||
| SegmentName = "supportTickets", | ||
| NamePattern = "" | ||
| >>, | ||
| }, | ||
| KeysOf<ResourceNameParameter< | ||
| Resource = CommunicationDetails, | ||
| KeyName = "communicationName", | ||
| SegmentName = "communications", | ||
| NamePattern = "" | ||
| >> | ||
| > {} | ||
|
|
||
| @armResourceOperations | ||
| interface Communications { | ||
| /** | ||
| * Returns communication details for a support ticket. | ||
| */ | ||
| get is CommunicationOps.Read<CommunicationDetails>; | ||
|
|
||
| /** | ||
| * Adds a new customer communication to an Azure support ticket. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility" | ||
| create is CommunicationOps.CreateOrUpdateAsync< | ||
| CommunicationDetails, | ||
| Response = ArmResourceUpdatedResponse<CommunicationDetails> | ArmAcceptedLroResponse | ||
| >; | ||
|
|
||
| /** | ||
| * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results. <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. | ||
| */ | ||
| list is CommunicationOps.List< | ||
| CommunicationDetails, | ||
| Parameters = { | ||
| /** | ||
| * The number of values to return in the collection. Default is 10 and max is 10. | ||
| */ | ||
| @query("$top") | ||
| $top?: int32; | ||
|
|
||
| /** | ||
| * The filter to apply on the operation. You can filter by communicationType and createdDate properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical And ('and') operator. | ||
| */ | ||
| @query("$filter") | ||
| $filter?: string; | ||
| } | ||
| >; | ||
| } | ||
| @armResourceOperations | ||
| interface CommunicationsNoSubscriptionOps | ||
| extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...Azure.ResourceManager.Legacy.Provider, | ||
| ...KeysOf<ResourceNameParameter< | ||
| Resource = SupportTicketDetails, | ||
| KeyName = "supportTicketName", | ||
| SegmentName = "supportTickets", | ||
| NamePattern = "" | ||
| >>, | ||
| }, | ||
| KeysOf<ResourceNameParameter< | ||
| Resource = CommunicationDetails, | ||
| KeyName = "communicationName", | ||
| SegmentName = "communications", | ||
| NamePattern = "" | ||
| >> | ||
| > {} | ||
|
|
||
| @armResourceOperations | ||
| interface CommunicationsNoSubscription { | ||
| /** | ||
| * Returns communication details for a support ticket. | ||
| */ | ||
| get is CommunicationsNoSubscriptionOps.Read<CommunicationDetails>; | ||
|
|
||
| /** | ||
| * Adds a new customer communication to an Azure support ticket. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility" | ||
| create is CommunicationsNoSubscriptionOps.CreateOrUpdateAsync< | ||
| CommunicationDetails, | ||
| Response = ArmResourceUpdatedResponse<CommunicationDetails> | ArmAcceptedLroResponse | ||
msyyc marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| >; | ||
|
|
||
| /** | ||
| * Lists all communications (attachments not included) for a support ticket. <br/></br> You can also filter support ticket communications by _CreatedDate_ or _CommunicationType_ using the $filter parameter. The only type of communication supported today is _Web_. Output will be a paged result with _nextLink_, using which you can retrieve the next set of Communication results. <br/><br/>Support ticket data is available for 18 months after ticket creation. If a ticket was created more than 18 months ago, a request for data might cause an error. | ||
| */ | ||
| list is CommunicationsNoSubscriptionOps.List< | ||
| CommunicationDetails, | ||
| Parameters = { | ||
| /** | ||
| * The number of values to return in the collection. Default is 10 and max is 10. | ||
| */ | ||
| @query("$top") | ||
| $top?: int32; | ||
|
|
||
| /** | ||
| * The filter to apply on the operation. You can filter by communicationType and createdDate properties. CommunicationType supports Equals ('eq') operator and createdDate supports Greater Than ('gt') and Greater Than or Equals ('ge') operators. You may combine the CommunicationType and CreatedDate filters by Logical And ('and') operator. | ||
| */ | ||
| @query("$filter") | ||
| $filter?: string; | ||
| } | ||
| >; | ||
| } | ||
|
|
||
| @@doc(CommunicationDetails.name, "Communication name."); | ||
| @@doc(CommunicationDetails.properties, "Properties of the resource."); | ||
| @@doc(Communications.create::parameters.resource, "Communication object."); | ||
| @@doc(CommunicationsNoSubscription.create::parameters.resource, | ||
| "Communication object." | ||
| ); | ||
133 changes: 133 additions & 0 deletions
133
specification/support/Support.Management/FileDetails.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,133 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/openapi"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
| import "./FileWorkspaceDetails.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using TypeSpec.OpenAPI; | ||
|
|
||
| namespace Microsoft.Support; | ||
| /** | ||
| * Object that represents File Details resource | ||
| */ | ||
| @parentResource(FileWorkspaceDetails) | ||
| model FileDetails | ||
| is Azure.ResourceManager.ProxyResource<FileDetailsProperties> { | ||
| ...ResourceNameParameter< | ||
| Resource = FileDetails, | ||
| KeyName = "fileName", | ||
| SegmentName = "files", | ||
| NamePattern = "" | ||
| >; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface FileOps | ||
| extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...SubscriptionIdParameter, | ||
| ...Azure.ResourceManager.Legacy.Provider, | ||
| ...KeysOf<ResourceNameParameter< | ||
| Resource = FileWorkspaceDetails, | ||
| KeyName = "fileWorkspaceName", | ||
| SegmentName = "fileWorkspaces", | ||
| NamePattern = "" | ||
| >>, | ||
| }, | ||
| KeysOf<ResourceNameParameter< | ||
| Resource = FileDetails, | ||
| KeyName = "fileName", | ||
| SegmentName = "files", | ||
| NamePattern = "" | ||
| >> | ||
| > {} | ||
|
|
||
| @armResourceOperations | ||
| interface Files { | ||
| /** | ||
| * Returns details of a specific file in a work space. | ||
| */ | ||
| get is FileOps.Read<FileDetails>; | ||
|
|
||
| /** | ||
| * Creates a new file under a workspace for the specified subscription. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility" | ||
| create is FileOps.CreateOrUpdateSync< | ||
| FileDetails, | ||
| Response = ArmResourceCreatedSyncResponse<FileDetails> | ||
| >; | ||
|
|
||
| /** | ||
| * Lists all the Files information under a workspace for an Azure subscription. | ||
| */ | ||
| list is FileOps.List<FileDetails>; | ||
|
|
||
| /** | ||
| * This API allows you to upload content to a file | ||
| */ | ||
| upload is FileOps.ActionSync<FileDetails, UploadFile, NoContentResponse>; | ||
| } | ||
| @armResourceOperations | ||
| interface FilesNoSubscriptionOps | ||
| extends Azure.ResourceManager.Legacy.LegacyOperations< | ||
| { | ||
| ...ApiVersionParameter, | ||
| ...Azure.ResourceManager.Legacy.Provider, | ||
| ...KeysOf<ResourceNameParameter< | ||
| Resource = FileWorkspaceDetails, | ||
| KeyName = "fileWorkspaceName", | ||
| SegmentName = "fileWorkspaces", | ||
| NamePattern = "" | ||
| >>, | ||
| }, | ||
| KeysOf<ResourceNameParameter< | ||
| Resource = FileDetails, | ||
| KeyName = "fileName", | ||
| SegmentName = "files", | ||
| NamePattern = "" | ||
| >> | ||
| > {} | ||
|
|
||
| @armResourceOperations | ||
| interface FilesNoSubscription { | ||
| /** | ||
| * Returns details of a specific file in a work space. | ||
| */ | ||
| get is FilesNoSubscriptionOps.Read<FileDetails>; | ||
|
|
||
| /** | ||
| * Creates a new file under a workspace. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "For backward compatibility" | ||
| create is FilesNoSubscriptionOps.CreateOrUpdateSync< | ||
| FileDetails, | ||
| Response = ArmResourceCreatedSyncResponse<FileDetails> | ||
| >; | ||
|
|
||
| /** | ||
| * Lists all the Files information under a workspace for an Azure subscription. | ||
| */ | ||
| list is FilesNoSubscriptionOps.List<FileDetails>; | ||
|
|
||
| /** | ||
| * This API allows you to upload content to a file | ||
| */ | ||
| upload is FilesNoSubscriptionOps.ActionSync< | ||
| FileDetails, | ||
| UploadFile, | ||
| NoContentResponse | ||
| >; | ||
| } | ||
|
|
||
| @@doc(FileDetails.name, "File Name"); | ||
| @@doc(FileDetails.properties, "Properties of the resource"); | ||
| @@doc(Files.create::parameters.resource, "Create file object"); | ||
| @@doc(Files.upload::parameters.body, "UploadFile object"); | ||
| @@doc(FilesNoSubscription.create::parameters.resource, "Create file object"); | ||
| @@doc(FilesNoSubscription.upload::parameters.body, "UploadFile object"); |
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.