-
Notifications
You must be signed in to change notification settings - Fork 5.7k
[TSP Migration][domainregistration] TypeSpec migrated from swagger #36733
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 all commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
6a1bc7e
The first version of TSP
v-zhocai 59119b6
fix error and diff
v-zhocai 9df12f9
solve warning
v-zhocai e34cff3
modify readme and delete old json
v-zhocai 91dcd21
Merge branch 'main' into convert/domainregistration
v-zhocai 2bcfdf1
update tspconfig.yaml
v-zhocai 879daa2
fix operationid and other errors
v-zhocai ace1a98
fix added model
v-zhocai 4e4b844
modify parameter name
v-zhocai 8b932c6
update
welovej 9808c2f
update
v-zhocai 8130589
use DefaultErrorResponce
v-zhocai b1ae3fc
delete duplicate dnstype
v-zhocai 04e07bf
Merge branch 'main' into convert/domainregistration
v-zhocai 4130b1f
fix ci error
v-zhocai 3be28a6
fix swagger modelvalidation error
v-zhocai c040100
delete unused decorator and suppress
v-zhocai 1e2a7b1
fix swagger avocado
v-zhocai 26d2044
Update Domain.tsp
v-zhocai f8eb5b2
update tspconfig.yaml
v-zhocai 19db79c
update back-compatible.tsp
v-zhocai b00c43a
Merge branch 'main' into convert/domainregistration
v-zhocai 71c13d0
update according to review
v-zhocai dd4bd0c
Merge branch 'main' into convert/domainregistration
v-zhocai eab673d
move files and modify tspconfig
v-zhocai 05dcaf6
modify tspconfig
v-zhocai 4727581
modify tspconfig
v-zhocai 4640b7e
update readme
v-zhocai e97be7f
Merge branch 'Azure:main' into convert/domainregistration
v-zhocai 005aa4f
update to use decorator directly
v-zhocai aeed3ee
Update
v-zhocai f5709d9
Update
v-zhocai b6cbaa9
Update
v-zhocai 4f68803
run tsp format
v-zhocai aea72df
fix diff
v-zhocai 99ee592
add summary
v-zhocai 5e120c3
delete CommonDefinitions.json
v-zhocai c559dd2
Merge branch 'main' into convert/domainregistration
v-zhocai 49c456d
several diff fix
v-zhocai be7734e
update tspconfig
v-zhocai ecb43f0
delete sparse-spec
v-zhocai fc11581
update
v-zhocai 8ce68cc
fix suppress
v-zhocai 6edffe5
update
v-zhocai a6d24fa
update according to comments
v-zhocai 1751fb9
update
v-zhocai 27d1fb4
Merge branch 'main' into convert/domainregistration
v-jiaodi f87e6f0
Merge branch 'main' into convert/domainregistration
v-jiaodi b7128ff
Merge branch 'main' into convert/domainregistration
v-jiaodi d37a652
update client name for js sdk
v-jiaodi 0ef0a9a
Merge branch 'convert/domainregistration' of https://github.com/v-zho…
v-jiaodi e2ba850
Merge branch 'main' into convert/domainregistration
welovej 8d86af4
Suppress legacy usage warnings in back-compatible.tsp
welovej 3cf6b96
Suppress warnings for secret properties in models
welovej 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
141 changes: 141 additions & 0 deletions
141
specification/domainregistration/DomainRegistration.Management/Domain.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,141 @@ | ||
| 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.DomainRegistration; | ||
| /** | ||
| * Information about a domain. | ||
| */ | ||
| model Domain is Azure.ResourceManager.TrackedResource<DomainProperties> { | ||
| ...ResourceNameParameter< | ||
| Resource = Domain, | ||
| KeyName = "domainName", | ||
| SegmentName = "domains", | ||
| NamePattern = "[a-zA-Z0-9][a-zA-Z0-9\\.-]+" | ||
| >; | ||
|
|
||
| /** | ||
| * Kind of resource | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| kind?: string; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface Domains { | ||
| /** | ||
| * Description for Get a domain. | ||
| */ | ||
| @summary("Get a domain.") | ||
| get is ArmResourceRead<Domain, Error = DefaultErrorResponse>; | ||
|
|
||
| /** | ||
| * Description for Creates or updates a domain. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @summary("Creates or updates a domain.") | ||
| createOrUpdate is ArmResourceCreateOrReplaceAsync< | ||
| Domain, | ||
| Response = ArmResourceUpdatedResponse<Domain> | (ArmAcceptedLroResponse<LroHeaders = ArmLroLocationHeader<FinalResult = Domain>> & { | ||
| @bodyRoot | ||
| _: Domain; | ||
| }), | ||
| Error = DefaultErrorResponse | ||
| >; | ||
|
|
||
| /** | ||
| * Description for Creates or updates a domain. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/no-response-body" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @patch(#{ implicitOptionality: false }) | ||
| @summary("Creates or updates a domain.") | ||
| update is ArmCustomPatchSync< | ||
| Domain, | ||
| PatchModel = DomainPatchResource, | ||
| Response = ArmResponse<Domain> | (ArmAcceptedResponse & { | ||
| @bodyRoot | ||
| _: Domain; | ||
| }), | ||
| Error = DefaultErrorResponse | ||
| >; | ||
|
|
||
| /** | ||
| * Description for Delete a domain. | ||
| */ | ||
| @summary("Delete a domain.") | ||
| delete is ArmResourceDeleteSync< | ||
| Domain, | ||
| Parameters = { | ||
| /** | ||
| * Specify <code>true</code> to delete the domain immediately. The default is <code>false</code> which deletes the domain after 24 hours. | ||
| */ | ||
| @query("forceHardDeleteDomain") | ||
| forceHardDeleteDomain?: boolean; | ||
| }, | ||
| Error = DefaultErrorResponse | ||
| >; | ||
|
|
||
| /** | ||
| * Description for Get all domains in a resource group. | ||
| */ | ||
| @summary("Get all domains in a resource group.") | ||
| listByResourceGroup is ArmResourceListByParent< | ||
| Domain, | ||
| Response = ArmResponse<DomainCollection>, | ||
| Error = DefaultErrorResponse | ||
| >; | ||
|
|
||
| /** | ||
| * Description for Get all domains in a subscription. | ||
| */ | ||
| @summary("Get all domains in a subscription.") | ||
| list is ArmListBySubscription< | ||
| Domain, | ||
| Response = ArmResponse<DomainCollection>, | ||
| Error = DefaultErrorResponse | ||
| >; | ||
|
|
||
| /** | ||
| * Description for Renew a domain. | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/lro-location-header" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @summary("Renew a domain.") | ||
| renew is ArmResourceActionSync< | ||
| Domain, | ||
| void, | ||
| OkResponse | ArmAcceptedResponse | NoContentResponse, | ||
| Error = DefaultErrorResponse | ||
| >; | ||
|
|
||
| /** | ||
| * Transfer out domain to another registrar | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @put | ||
| @summary("Transfer out domain to another registrar") | ||
| transferOut is ArmResourceActionSync< | ||
| Domain, | ||
| void, | ||
| ArmResponse<Domain> | ArmBadRequestResponse, | ||
| Error = DefaultErrorResponse | ||
| >; | ||
| } | ||
|
|
||
| @@doc(Domain.name, "Name of the domain."); | ||
| @@doc(Domain.properties, "Domain resource specific properties"); | ||
| @@doc(Domains.createOrUpdate::parameters.resource, | ||
| "Domain registration information." | ||
| ); | ||
| @@doc(Domains.update::parameters.properties, | ||
| "Domain registration information." | ||
| ); | ||
96 changes: 96 additions & 0 deletions
96
specification/domainregistration/DomainRegistration.Management/DomainOwnershipIdentifier.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,96 @@ | ||
| import "@azure-tools/typespec-azure-core"; | ||
| import "@azure-tools/typespec-azure-resource-manager"; | ||
| import "@typespec/openapi"; | ||
| import "@typespec/rest"; | ||
| import "./models.tsp"; | ||
| import "./Domain.tsp"; | ||
|
|
||
| using TypeSpec.Rest; | ||
| using Azure.ResourceManager; | ||
| using TypeSpec.Http; | ||
| using TypeSpec.OpenAPI; | ||
|
|
||
| namespace Microsoft.DomainRegistration; | ||
| /** | ||
| * Domain ownership Identifier. | ||
| */ | ||
| @parentResource(Domain) | ||
| model DomainOwnershipIdentifier | ||
| is Azure.ResourceManager.ProxyResource<DomainOwnershipIdentifierProperties> { | ||
| ...ResourceNameParameter< | ||
| Resource = DomainOwnershipIdentifier, | ||
| KeyName = "name", | ||
| SegmentName = "domainOwnershipIdentifiers", | ||
| NamePattern = "" | ||
| >; | ||
|
|
||
| /** | ||
| * Kind of resource | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| kind?: string; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface DomainOwnershipIdentifiers { | ||
| /** | ||
| * Description for Get ownership identifier for domain | ||
| */ | ||
| @summary("Get ownership identifier for domain") | ||
| getOwnershipIdentifier is ArmResourceRead< | ||
| DomainOwnershipIdentifier, | ||
| Error = DefaultErrorResponse | ||
| >; | ||
|
|
||
| /** | ||
| * Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @summary("Creates an ownership identifier for a domain or updates identifier details for an existing identifier") | ||
| createOrUpdateOwnershipIdentifier is ArmResourceCreateOrReplaceSync< | ||
| DomainOwnershipIdentifier, | ||
| Response = ArmResourceUpdatedResponse<DomainOwnershipIdentifier>, | ||
| Error = DefaultErrorResponse | ||
| >; | ||
|
|
||
| /** | ||
| * Description for Creates an ownership identifier for a domain or updates identifier details for an existing identifier | ||
| */ | ||
| @patch(#{ implicitOptionality: false }) | ||
| @summary("Creates an ownership identifier for a domain or updates identifier details for an existing identifier") | ||
| updateOwnershipIdentifier is ArmCustomPatchSync< | ||
| DomainOwnershipIdentifier, | ||
| PatchModel = DomainOwnershipIdentifier, | ||
| Error = DefaultErrorResponse | ||
| >; | ||
|
|
||
| /** | ||
| * Description for Delete ownership identifier for domain | ||
| */ | ||
| @summary("Delete ownership identifier for domain") | ||
| deleteOwnershipIdentifier is ArmResourceDeleteSync< | ||
| DomainOwnershipIdentifier, | ||
| Error = DefaultErrorResponse | ||
| >; | ||
|
|
||
| /** | ||
| * Description for Lists domain ownership identifiers. | ||
| */ | ||
| @summary("Lists domain ownership identifiers.") | ||
| listOwnershipIdentifiers is ArmResourceListByParent< | ||
| DomainOwnershipIdentifier, | ||
| Response = ArmResponse<DomainOwnershipIdentifierCollection>, | ||
| Error = DefaultErrorResponse | ||
| >; | ||
| } | ||
|
|
||
| @@doc(DomainOwnershipIdentifier.name, "Name of identifier."); | ||
| @@doc(DomainOwnershipIdentifier.properties, | ||
| "DomainOwnershipIdentifier resource specific properties" | ||
| ); | ||
| @@doc(DomainOwnershipIdentifiers.createOrUpdateOwnershipIdentifier::parameters.resource, | ||
| "A JSON representation of the domain ownership properties." | ||
| ); | ||
| @@doc(DomainOwnershipIdentifiers.updateOwnershipIdentifier::parameters.properties, | ||
| "A JSON representation of the domain ownership properties." | ||
| ); |
74 changes: 74 additions & 0 deletions
74
specification/domainregistration/DomainRegistration.Management/TopLevelDomain.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,74 @@ | ||
| 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.DomainRegistration; | ||
| /** | ||
| * A top level domain object. | ||
| */ | ||
| @subscriptionResource | ||
| model TopLevelDomain | ||
| is Azure.ResourceManager.ProxyResource<TopLevelDomainProperties> { | ||
| ...ResourceNameParameter< | ||
| Resource = TopLevelDomain, | ||
| KeyName = "name", | ||
| SegmentName = "topLevelDomains", | ||
| NamePattern = "" | ||
| >; | ||
|
|
||
| /** | ||
| * Kind of resource | ||
| */ | ||
| #suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| kind?: string; | ||
| } | ||
|
|
||
| @armResourceOperations | ||
| interface TopLevelDomains { | ||
| /** | ||
| * Description for Get details of a top-level domain. | ||
| */ | ||
| @summary("Get details of a top-level domain.") | ||
| get is ArmResourceRead< | ||
| TopLevelDomain, | ||
| BaseParameters = Azure.ResourceManager.Foundations.SubscriptionBaseParameters, | ||
| Error = DefaultErrorResponse | ||
| >; | ||
|
|
||
| /** | ||
| * Description for Get all top-level domains supported for registration. | ||
| */ | ||
| @summary("Get all top-level domains supported for registration.") | ||
| list is ArmResourceListByParent< | ||
| TopLevelDomain, | ||
| BaseParameters = Azure.ResourceManager.Foundations.SubscriptionBaseParameters, | ||
| Response = ArmResponse<TopLevelDomainCollection>, | ||
| Error = DefaultErrorResponse | ||
| >; | ||
|
|
||
| /** | ||
| * Description for Gets all legal agreements that user needs to accept before purchasing a domain. | ||
| */ | ||
| @list | ||
| @summary("Gets all legal agreements that user needs to accept before purchasing a domain.") | ||
| listAgreements is ArmResourceActionSync< | ||
| TopLevelDomain, | ||
| TopLevelDomainAgreementOption, | ||
| ArmResponse<TldLegalAgreementCollection>, | ||
| BaseParameters = Azure.ResourceManager.Foundations.SubscriptionBaseParameters, | ||
| Error = DefaultErrorResponse | ||
| >; | ||
| } | ||
|
|
||
| @@doc(TopLevelDomain.name, "Name of the top-level domain."); | ||
| @@doc(TopLevelDomain.properties, "TopLevelDomain resource specific properties"); | ||
| @@doc(TopLevelDomains.listAgreements::parameters.body, | ||
| "Domain agreement options." | ||
| ); |
49 changes: 49 additions & 0 deletions
49
specification/domainregistration/DomainRegistration.Management/back-compatible.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,49 @@ | ||
| import "@azure-tools/typespec-client-generator-core"; | ||
|
|
||
| using Azure.ClientGenerator.Core; | ||
| using Azure.ClientGenerator.Core.Legacy; | ||
| using Microsoft.DomainRegistration; | ||
|
|
||
| @@clientName(Domains.createOrUpdate::parameters.resource, "domain"); | ||
| @@clientName(Domains.update::parameters.properties, "domain"); | ||
| @@clientLocation(DomainOwnershipIdentifiers.getOwnershipIdentifier, Domains); | ||
| @@clientLocation(DomainOwnershipIdentifiers.createOrUpdateOwnershipIdentifier, | ||
| Domains | ||
| ); | ||
| @@clientName(DomainOwnershipIdentifiers.createOrUpdateOwnershipIdentifier::parameters.resource, | ||
| "domainOwnershipIdentifier" | ||
| ); | ||
| @@clientLocation(DomainOwnershipIdentifiers.updateOwnershipIdentifier, Domains); | ||
| @@clientName(DomainOwnershipIdentifiers.updateOwnershipIdentifier::parameters.properties, | ||
| "domainOwnershipIdentifier" | ||
| ); | ||
| @@clientLocation(DomainOwnershipIdentifiers.deleteOwnershipIdentifier, Domains); | ||
| @@clientLocation(DomainOwnershipIdentifiers.listOwnershipIdentifiers, Domains); | ||
|
|
||
| @@clientName(TopLevelDomains.listAgreements::parameters.body, | ||
| "agreementOption" | ||
| ); | ||
| @@clientLocation(DomainsOperationGroup.checkAvailability, Domains); | ||
| @@clientLocation(DomainsOperationGroup.getControlCenterSsoRequest, Domains); | ||
| @@clientLocation(DomainsOperationGroup.listRecommendations, Domains); | ||
|
|
||
| @@clientName(DomainsOperationGroup.listRecommendations::parameters.body, | ||
| "parameters" | ||
| ); | ||
| @@clientName(DomainsOperationGroup.checkAvailability::parameters.body, | ||
| "identifier" | ||
| ); | ||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(DomainOwnershipIdentifier.properties); | ||
|
|
||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(DomainPatchResource.properties); | ||
|
|
||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(TopLevelDomain.properties); | ||
|
|
||
| #suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details" | ||
| @@flattenProperty(Domain.properties); | ||
|
|
||
| @@clientLocation(Operations.list, "DomainRegistrationProvider"); | ||
| @@clientName(Operations.list, "ListOperations"); |
9 changes: 9 additions & 0 deletions
9
specification/domainregistration/DomainRegistration.Management/client.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,9 @@ | ||
| import "@azure-tools/typespec-client-generator-core"; | ||
| import "./main.tsp"; | ||
|
|
||
| using Azure.ClientGenerator.Core; | ||
|
|
||
| @@clientName(Microsoft.DomainRegistration, | ||
| "DomainRegistrationManagementClient", | ||
| "javascript" | ||
| ); |
20 changes: 20 additions & 0 deletions
20
...gistration/DomainRegistration.Management/examples/2024-11-01/CheckDomainAvailability.json
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,20 @@ | ||
| { | ||
| "parameters": { | ||
| "api-version": "2024-11-01", | ||
| "identifier": { | ||
| "name": "abcd.com" | ||
| }, | ||
| "subscriptionId": "34adfa4f-cedf-4dc0-ba29-b6d1a69ab345" | ||
| }, | ||
| "responses": { | ||
| "200": { | ||
| "body": { | ||
| "name": "abcd.com", | ||
| "available": true, | ||
| "domainType": "Regular" | ||
| } | ||
| } | ||
| }, | ||
| "operationId": "Domains_CheckAvailability", | ||
| "title": "Check domain availability" | ||
| } |
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.