Skip to content

[Test] Migrate voiceservices to TypeSpec #3098

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
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
dd60999
Update widgets.json
raych1 Sep 12, 2023
a4f05e9
Merge pull request #3017 from test-repo-billy/user/raych1/typespec-test
raych1 Sep 12, 2023
4d5a926
Update widgets.json
raych1 Sep 12, 2023
68272cf
Merge pull request #3018 from test-repo-billy/user/raych1/typespec-test1
raych1 Sep 13, 2023
a6a8dd4
Update widgets.json
raych1 Sep 15, 2023
78ab4d0
Merge pull request #3020 from test-repo-billy/user/raych1/typespec-te…
raych1 Sep 15, 2023
a1fc01f
Update widgets.json
raych1 Sep 15, 2023
5c544ab
Merge pull request #3021 from test-repo-billy/user/raych1/typespec-te…
raych1 Sep 15, 2023
1fe48fa
Testing assistant
raych1 Sep 18, 2023
23ede72
Merge pull request #3022 from test-repo-billy/user/raych1/test-assistant
raych1 Sep 18, 2023
c3a4421
Update widgets.json
raych1 Sep 18, 2023
7df9bd5
Merge pull request #3023 from test-repo-billy/user/raych1/test-sdk-as…
raych1 Sep 18, 2023
80ebd30
Merge branch 'Azure:main' into main
konrad-jamrozik Sep 29, 2023
e31cc31
Create bug.md (#3051)
raych1 Oct 26, 2023
d5975d6
Rename bug.md to bug_report.md (#3052)
raych1 Oct 26, 2023
d9f7ab1
Update issue templates (#3053)
raych1 Oct 26, 2023
039bbb3
Update bug_report.md (#3054)
raych1 Oct 26, 2023
4b4e0b0
issue template update (#3055)
raych1 Oct 26, 2023
16ef281
Merge branch 'Azure:main' into main
konrad-jamrozik Nov 14, 2023
85f03c4
Update README.md
Nov 14, 2023
fc580aa
Merge pull request #3089 from test-repo-billy/konrad-jamrozik-patch-5
Nov 14, 2023
581769e
Update README.md
Nov 14, 2023
8491587
Merge pull request #3090 from test-repo-billy/konrad-jamrozik-patch-6
Nov 14, 2023
7832735
Update README.md
Nov 15, 2023
3c19f6f
Merge pull request #3092 from test-repo-billy/konrad-jamrozik-patch-7
Nov 15, 2023
36263d6
Update README.md
Nov 16, 2023
1a7ca15
Merge pull request #3093 from test-repo-billy/konrad-jamrozik-patch-8
Nov 16, 2023
534edcd
Migrate voiceservices to TypeSpec
Nov 30, 2023
8fcfba4
update openapi.json
Nov 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug Report
about: Report bugs.
---
### Bug Report

<!--
Thank you for opening a bug report. For faster processing, please include:
-->

- What is your query?

- What is the link if your query contain a github spec PR?

- What is the problem?

- What is your expectation?

- What is the Screenshot if have?

- What is the link to your post in Teams Channel?

- Anything we should know about your environment.

<!--
Thanks!
-->
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,5 @@ External Contributors can read [Getting Started with OpenAPI Specifications](htt

---
_This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments._

test pr 5
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Definitions for the CommunicationsGateway resource and child resources

import "@cadl-lang/openapi";
import "@cadl-lang/rest";
import "@azure-tools/cadl-providerhub";
import "@azure-tools/cadl-autorest";
import "@azure-tools/cadl-azure-core";
import "@azure-tools/cadl-azure-resource-manager";
import "@TypeSpec-lang/openapi";
import "@TypeSpec-lang/rest";
import "@azure-tools/TypeSpec-providerhub";
import "@azure-tools/TypeSpec-autorest";
import "@azure-tools/TypeSpec-azure-core";
import "@azure-tools/TypeSpec-azure-resource-manager";

namespace Microsoft.VoiceServices;

using Cadl.Http;
using Cadl.Rest;
using Cadl.Versioning;
using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.ResourceManager;

@doc("A TestLine resource")
Expand Down Expand Up @@ -262,24 +262,3 @@ interface CommunicationsGateways
ResourceListByParent<CommunicationsGateway>,
ResourceUpdateNoProperties<CommunicationsGateway> {}

#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-interface-requires-decorator" "CheckNameAvailability is not supported by cadl-azure-resource-manager."
#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-interface-uses-templates" "CheckNameAvailability is not supported by cadl-azure-resource-manager."
#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-operation-missing-decorator" "CheckNameAvailability is not supported by cadl-azure-resource-manager."
@added(Versions.v2023_01_31)
interface NameAvailability {
@doc("Check whether the resource name is available in the given region.")
@post
@route("/subscriptions/{subscriptionId}/providers/Microsoft.VoiceServices/locations/{location}/checkNameAvailability")
checkLocal(
@doc("The check availability request body.")
@body
body: CheckNameAvailabilityRequest,

@doc("The location in which uniqueness will be verified.")
@path
location: string,

...SubscriptionIdParameter,
...ApiVersionParameter
): CheckNameAvailabilityResponse | ErrorResponse;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// First, import the common Microsoft.VoiceServices definition
import "./voiceservices.cadl";
import "./voiceservices.tsp";

// Then import the resource API definitions
import "./communicationsgateway.cadl";
import "./communicationsgateway.tsp";
import "./operatorvoicemail.tsp";
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// Definitions for the OperatorVoicemailInstance resource

import "@cadl-lang/openapi";
import "@cadl-lang/rest";
import "@azure-tools/cadl-providerhub";
import "@azure-tools/cadl-autorest";
import "@azure-tools/cadl-azure-core";
import "@azure-tools/cadl-azure-resource-manager";
import "@TypeSpec-lang/openapi";
import "@TypeSpec-lang/rest";
import "@azure-tools/TypeSpec-providerhub";
import "@azure-tools/TypeSpec-autorest";
import "@azure-tools/TypeSpec-azure-core";
import "@azure-tools/TypeSpec-azure-resource-manager";

namespace Microsoft.VoiceServices;

using Cadl.Http;
using Cadl.Rest;
using Cadl.Versioning;
using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.ResourceManager;

@doc("A OperatorVoicemailInstance resource")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
emit:
- "@azure-tools/typespec-autorest"

options:
'@azure-tools/typespec-autorest':
azure-resource-provider-folder: "resource-manager"
emitter-output-dir: "{project-root}/.."
examples-directory: "{project-root}/examples"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/voiceservices.json"
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import "@cadl-lang/rest";
import "@azure-tools/cadl-providerhub";
import "@azure-tools/cadl-autorest";
import "@azure-tools/cadl-azure-core";
import "@azure-tools/cadl-azure-resource-manager";
import "@cadl-lang/versioning";

using Cadl.Http;
using Cadl.Rest;
using Cadl.Versioning;
import "@TypeSpec-lang/rest";
import "@azure-tools/TypeSpec-providerhub";
import "@azure-tools/TypeSpec-autorest";
import "@azure-tools/TypeSpec-azure-core";
import "@azure-tools/TypeSpec-azure-resource-manager";
import "@TypeSpec-lang/versioning";

using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.ResourceManager;

@armProviderNamespace("Microsoft.VoiceServices")
Expand Down Expand Up @@ -72,8 +72,8 @@ model ResourceUpdateModelNoProperties<TResource extends object>
"Name" | "name"
>>>;

#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-interface-requires-decorator" "Interface template does not require this."
#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-interface-uses-templates" "This is an official operations template."
#suppress "@azure-tools/TypeSpec-azure-resource-manager/arm-resource-interface-requires-decorator" "Interface template does not require this."
#suppress "@azure-tools/TypeSpec-azure-resource-manager/arm-resource-interface-uses-templates" "This is an official operations template."
@doc("Template for resources with no updateable properties")
@armResourceOperations
interface ResourceUpdateNoProperties<TResource extends Foundations.ArmResource> {
Expand All @@ -90,13 +90,13 @@ interface ResourceUpdateNoProperties<TResource extends Foundations.ArmResource>
): ArmResponse<TResource> | ErrorResponse;
}

// These models should be provided by the common CADL infra, but currently they are not. See GitHub PR:
// https://github.com/Azure/cadl-azure/pull/2311
// These models should be provided by the common TypeSpec infra, but currently they are not. See GitHub PR:
// https://github.com/Azure/TypeSpec-azure/pull/2311
// For now, these definitions are reimplementations of the common types from:
// https://github.com/Azure/azure-rest-api-specs-pr/blob/66dc2c9a0243bc217a938583a53da052498ac39f/specification/common-types/resource-management/v3/types.json

// Ideally all of these would be marked as @added(Versions.v2022_12_02_preview) but they can't be because of
// https://github.com/microsoft/cadl/issues/1332
// https://github.com/microsoft/TypeSpec/issues/1332

@doc("The check availability request body.")
model CheckNameAvailabilityRequest {
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"info": {
"title": "Microsoft.VoiceServices",
"version": "2022-12-01-preview",
"x-cadl-generated": [
"x-typespec-generated": [
{
"emitter": "@azure-tools/cadl-autorest"
"emitter": "@azure-tools/typespec-autorest"
}
]
},
Expand Down Expand Up @@ -951,13 +951,13 @@
"items": {
"$ref": "#/definitions/CommunicationsGateway"
},
"x-cadl-name": "CommunicationsGateway[]",
"x-typespec-name": "CommunicationsGateway[]",
"description": "The CommunicationsGateway items on this page"
},
"nextLink": {
"type": "string",
"description": "The link to the next page of items",
"x-cadl-name": "Rest.ResourceLocation<CommunicationsGateway>"
"x-typespec-name": "Rest.ResourceLocation<CommunicationsGateway>"
}
},
"description": "The response of a CommunicationsGateway list operation.",
Expand Down Expand Up @@ -986,7 +986,7 @@
"x-ms-identifiers": [
"name"
],
"x-cadl-name": "ServiceRegionProperties[]",
"x-typespec-name": "ServiceRegionProperties[]",
"description": "The regions in which to deploy the resources needed for Teams Calling",
"x-ms-mutability": [
"read",
Expand All @@ -1007,7 +1007,7 @@
"items": {
"$ref": "#/definitions/TeamsCodecs"
},
"x-cadl-name": "TeamsCodecs[]",
"x-typespec-name": "TeamsCodecs[]",
"description": "Voice codecs to support",
"x-ms-mutability": [
"read",
Expand All @@ -1029,7 +1029,7 @@
"items": {
"$ref": "#/definitions/CommunicationsPlatform"
},
"x-cadl-name": "CommunicationsPlatform[]",
"x-typespec-name": "CommunicationsPlatform[]",
"description": "What platforms to support",
"x-ms-mutability": [
"read",
Expand Down Expand Up @@ -1064,7 +1064,7 @@
"additionalProperties": {
"type": "string"
},
"x-cadl-name": "Record<string>",
"x-typespec-name": "Record<string>",
"description": "Resource tags."
}
},
Expand Down Expand Up @@ -1128,13 +1128,13 @@
"items": {
"$ref": "#/definitions/Contact"
},
"x-cadl-name": "Contact[]",
"x-typespec-name": "Contact[]",
"description": "The Contact items on this page"
},
"nextLink": {
"type": "string",
"description": "The link to the next page of items",
"x-cadl-name": "Rest.ResourceLocation<Contact>"
"x-typespec-name": "Rest.ResourceLocation<Contact>"
}
},
"description": "The response of a Contact list operation.",
Expand Down Expand Up @@ -1203,7 +1203,7 @@
"additionalProperties": {
"type": "string"
},
"x-cadl-name": "Record<string>",
"x-typespec-name": "Record<string>",
"description": "Resource tags."
}
},
Expand Down Expand Up @@ -1241,7 +1241,7 @@
"items": {
"type": "string"
},
"x-cadl-name": "string[]",
"x-typespec-name": "string[]",
"description": "IP address to use to contact the operator network from this region",
"x-ms-mutability": [
"read",
Expand All @@ -1254,7 +1254,7 @@
"items": {
"type": "string"
},
"x-cadl-name": "string[]",
"x-typespec-name": "string[]",
"description": "IP address to use to contact the ESRP from this region",
"x-ms-mutability": [
"read",
Expand Down Expand Up @@ -1376,13 +1376,13 @@
"items": {
"$ref": "#/definitions/TestLine"
},
"x-cadl-name": "TestLine[]",
"x-typespec-name": "TestLine[]",
"description": "The TestLine items on this page"
},
"nextLink": {
"type": "string",
"description": "The link to the next page of items",
"x-cadl-name": "Rest.ResourceLocation<TestLine>"
"x-typespec-name": "Rest.ResourceLocation<TestLine>"
}
},
"description": "The response of a TestLine list operation.",
Expand Down Expand Up @@ -1443,7 +1443,7 @@
"additionalProperties": {
"type": "string"
},
"x-cadl-name": "Record<string>",
"x-typespec-name": "Record<string>",
"description": "Resource tags."
}
},
Expand Down
Loading