Skip to content

Commit 74b23e2

Browse files
authored
add or modify files (#22187)
1 parent c2a1aaa commit 74b23e2

33 files changed

+2847
-81
lines changed
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
emitters:
1+
emit:
2+
- "@azure-tools/cadl-autorest"
3+
- "@azure-tools/cadl-providerhub-controller"
4+
5+
options:
26
"@azure-tools/cadl-autorest":
3-
azure-resource-provider-folder: ./swagger/VoiceServices/resource-manager
7+
azure-resource-provider-folder: ./swagger/voiceservices/resource-manager
48
examples-directory: ./examples
9+
omit-unreachable-types: true
10+
output-file: voiceservices.json
11+
emitter-output-dir: "{output-dir}"
12+
513
"@azure-tools/cadl-providerhub-controller":
6-
code-kind: model
14+
emitter-output-dir: "{output-dir}/generated"

specification/voiceservices/resource-manager/Microsoft.VoiceServices/cadl/communicationsgateway.cadl

Lines changed: 135 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ namespace Microsoft.VoiceServices;
1111

1212
using Cadl.Http;
1313
using Cadl.Rest;
14+
using Cadl.Versioning;
1415
using Azure.ResourceManager;
1516

1617
@doc("A TestLine resource")
@@ -34,15 +35,21 @@ enum TestLinePurpose {
3435
@doc("Details of the TestLine resource.")
3536
model TestLineProperties is ResourceProperties {
3637
@doc("The phone number")
37-
@visibility("read", "write", "create")
38+
@visibility("read", "update", "create")
3839
phoneNumber: string;
40+
3941
@doc("Purpose of this test line, e.g. automated or manual testing")
40-
@visibility("read", "write", "create")
42+
@visibility("read", "update", "create")
4143
purpose: TestLinePurpose;
4244
}
4345

4446
@armResourceOperations
45-
interface TestLines extends ResourceRead<TestLine>, ResourceCreate<TestLine>, ResourceDelete<TestLine>, ResourceListByParent<TestLine>, ResourceUpdateNoProperties<TestLine> {}
47+
interface TestLines
48+
extends ResourceRead<TestLine>,
49+
ResourceCreate<TestLine>,
50+
ResourceDelete<TestLine>,
51+
ResourceListByParent<TestLine>,
52+
ResourceUpdateNoProperties<TestLine> {}
4653

4754
@doc("A Contact resource")
4855
@parentResource(CommunicationsGateway)
@@ -59,24 +66,34 @@ model Contact is TrackedResource<ContactProperties> {
5966
@doc("Details of the Contact resource.")
6067
model ContactProperties is ResourceProperties {
6168
@doc("Full name of contact")
62-
@visibility("read", "write", "create")
69+
@visibility("read", "update", "create")
6370
contactName: string;
71+
6472
@doc("Telephone number of contact")
65-
@visibility("read", "write", "create")
73+
@visibility("read", "update", "create")
6674
phoneNumber: string;
75+
6776
@doc("Email address of contact")
68-
@visibility("read", "write", "create")
77+
@visibility("read", "update", "create")
6978
email: string;
79+
7080
@doc("Job title of contact")
71-
@visibility("read", "write", "create")
81+
@visibility("read", "update", "create")
7282
role: string;
7383
}
7484

85+
@removed(Versions.v2023_01_31)
7586
@armResourceOperations
76-
interface Contacts extends ResourceRead<Contact>, ResourceCreate<Contact>, ResourceDelete<Contact>, ResourceListByParent<Contact>, ResourceUpdateNoProperties<Contact> {}
87+
interface Contacts
88+
extends ResourceRead<Contact>,
89+
ResourceCreate<Contact>,
90+
ResourceDelete<Contact>,
91+
ResourceListByParent<Contact>,
92+
ResourceUpdateNoProperties<Contact> {}
7793

7894
@doc("A CommunicationsGateway resource")
79-
model CommunicationsGateway is TrackedResource<CommunicationsGatewayProperties> {
95+
model CommunicationsGateway
96+
is TrackedResource<CommunicationsGatewayProperties> {
8097
@pattern("^[a-zA-Z0-9-]{3,24}$")
8198
@key("communicationsGatewayName")
8299
@segment("communicationsGateways")
@@ -90,107 +107,172 @@ model CommunicationsGateway is TrackedResource<CommunicationsGatewayProperties>
90107
enum Status {
91108
@doc("The resource has been created or updated, but the CommunicationsGateway service has not yet been updated to reflect the changes.")
92109
ChangePending,
110+
93111
@doc("The CommunicationsGateway service is up and running with the parameters specified in the resource.")
94112
Complete,
95113
}
96114

97115
@doc("The method for terminating emergency calls to the PSTN.")
98-
@knownValues(E911TypeValues)
99-
model E911Type is string {}
100-
enum E911TypeValues {
116+
enum E911Type {
101117
@doc("Emergency calls are not handled different from other calls")
102118
Standard,
119+
103120
@doc("Emergency calls are routed directly to the ESRP")
104-
DirectToEsrp
121+
DirectToEsrp,
105122
}
106123

107124
@doc("The voice codecs expected for communication with Teams.")
108-
@knownValues(TeamsCodecsValues)
109-
model TeamsCodecs is string {}
110-
enum TeamsCodecsValues {
111-
PCMA,
112-
PCMU,
113-
G722,
114-
G722_2,
115-
SILK_8,
116-
SILK_16
125+
enum TeamsCodecs {
126+
PCMA,
127+
PCMU,
128+
G722,
129+
G722_2,
130+
SILK_8,
131+
SILK_16,
117132
}
118133

119134
@doc("How this deployment connects back to the operator network")
120-
@knownValues(ConnectivityValues)
121-
model Connectivity is string {}
122-
enum ConnectivityValues {
135+
enum Connectivity {
123136
@doc("This deployment connects to the operator network using a Public IP address, e.g. when using MAPS")
124-
PublicAddress
137+
PublicAddress,
125138
}
126139

127140
@doc("The service region configuration needed for Teams Callings.")
128141
model ServiceRegionProperties {
129-
@doc("The name of the region in which the resources needed for Teams Calling will be deployed.")
130-
@visibility("read", "create")
131-
name: string;
142+
@doc("The name of the region in which the resources needed for Teams Calling will be deployed.")
143+
@visibility("read", "create")
144+
name: string;
132145

133-
@doc("The configuration used in this region as primary, and other regions as backup.")
134-
@visibility("read", "write", "create")
135-
primaryRegionProperties: PrimaryRegionProperties;
146+
@doc("The configuration used in this region as primary, and other regions as backup.")
147+
@visibility("read", "update", "create")
148+
primaryRegionProperties: PrimaryRegionProperties;
136149
}
137150

138151
@doc("The configuration used in this region as primary, and other regions as backup.")
139152
model PrimaryRegionProperties {
140-
@doc("IP address to use to contact the operator network from this region")
141-
@visibility("read", "write", "create")
142-
operatorAddresses: string[];
153+
@doc("IP address to use to contact the operator network from this region")
154+
@visibility("read", "update", "create")
155+
operatorAddresses: string[];
156+
157+
@doc("IP address to use to contact the ESRP from this region")
158+
@visibility("read", "update", "create")
159+
esrpAddresses?: string[];
143160

144-
@doc("IP address to use to contact the ESRP from this region")
145-
@visibility("read", "write", "create")
146-
esrpAddresses?: string[];
161+
@added(Versions.v2023_01_31)
162+
@doc("The allowed source IP address or CIDR ranges for signaling")
163+
@visibility("read", "update", "create")
164+
allowedSignalingSourceAddressPrefixes?: string[] = [];
165+
166+
@added(Versions.v2023_01_31)
167+
@doc("The allowed source IP address or CIDR ranges for media")
168+
@visibility("read", "update", "create")
169+
allowedMediaSourceAddressPrefixes?: string[] = [];
147170
}
148171

149172
@doc("Available platform types.")
150-
@knownValues(CommunicationsPlatformValues)
151-
model CommunicationsPlatform is string {}
152-
enum CommunicationsPlatformValues {
153-
OperatorConnect,
154-
TeamsPhoneMobile
173+
enum CommunicationsPlatform {
174+
OperatorConnect,
175+
TeamsPhoneMobile,
155176
}
156177

157178
// Currently empty, with presence indicating that this feature should be enabled.
158179
// This is expected to include more properties in future, hence being an object.
159180
@doc("Details of API bridge functionality.")
160181
model ApiBridgeProperties {}
161182

183+
@doc("Available auto-generated domain name scopes.")
184+
enum AutoGeneratedDomainNameLabelScope {
185+
TenantReuse,
186+
SubscriptionReuse,
187+
ResourceGroupReuse,
188+
NoReuse
189+
}
190+
162191
@doc("Details of the CommunicationsGateway resource.")
163192
model CommunicationsGatewayProperties is ResourceProperties {
164193
@doc("The current status of the deployment.")
165-
@visibility("read") status?: Status;
194+
@visibility("read")
195+
status?: Status;
166196

167197
@doc("The regions in which to deploy the resources needed for Teams Calling")
168198
@OpenAPI.extension("x-ms-identifiers", ["name"])
169-
@visibility("read", "write", "create")
199+
@visibility("read", "update", "create")
170200
serviceLocations: ServiceRegionProperties[];
171201

172202
@doc("How to connect back to the operator network, e.g. MAPS")
173203
@visibility("read", "create")
174204
connectivity: Connectivity;
175205

176206
@doc("Voice codecs to support")
177-
@visibility("read", "write", "create")
207+
@visibility("read", "update", "create")
178208
codecs: TeamsCodecs[];
179-
209+
180210
@doc("How to handle 911 calls")
181-
@visibility("read", "write", "create")
211+
@visibility("read", "update", "create")
182212
e911Type: E911Type;
183213

184214
@doc("What platforms to support")
185-
@visibility("read", "write", "create")
186-
// Can be set once we get a cald release with this decorator
187-
// @minItems(1)
215+
@visibility("read", "update", "create")
216+
@minItems(1)
188217
platforms: CommunicationsPlatform[];
189218

190219
@doc("Details of API bridge functionality, if required")
191-
@visibility("read", "write", "create")
220+
@visibility("read", "update", "create")
192221
apiBridge?: ApiBridgeProperties;
222+
223+
@added(Versions.v2023_01_31)
224+
@doc("The scope at which the auto-generated domain name can be re-used")
225+
@visibility("read", "create")
226+
autoGeneratedDomainNameLabelScope?: AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.TenantReuse;
227+
228+
@added(Versions.v2023_01_31)
229+
@doc("The autogenerated label used as part of the FQDNs for accessing the Communications Gateway")
230+
@visibility("read")
231+
autoGeneratedDomainNameLabel?: string;
232+
233+
@added(Versions.v2023_01_31)
234+
@doc("This number is used in Teams Phone Mobile scenarios for access to the voicemail IVR from the native dialer.")
235+
@visibility("read", "update", "create")
236+
teamsVoicemailPilotNumber?: string;
237+
238+
@added(Versions.v2023_01_31)
239+
@doc("Whether an on-premises Mobile Control Point is in use.")
240+
@visibility("read", "update", "create")
241+
onPremMcpEnabled?: boolean = false;
242+
243+
@added(Versions.v2023_01_31)
244+
@doc("A list of dial strings used for emergency calling.")
245+
@visibility("read", "update", "create")
246+
emergencyDialStrings?: string[] = ["911", "933"];
193247
}
194248

195249
@armResourceOperations
196-
interface CommunicationsGateways extends ResourceRead<CommunicationsGateway>, ResourceCreate<CommunicationsGateway>, ResourceDelete<CommunicationsGateway>, ResourceListBySubscription<CommunicationsGateway>, ResourceListByParent<CommunicationsGateway>, ResourceUpdateNoProperties<CommunicationsGateway> {}
250+
interface CommunicationsGateways
251+
extends ResourceRead<CommunicationsGateway>,
252+
ResourceCreate<CommunicationsGateway>,
253+
ResourceDelete<CommunicationsGateway>,
254+
ResourceListBySubscription<CommunicationsGateway>,
255+
ResourceListByParent<CommunicationsGateway>,
256+
ResourceUpdateNoProperties<CommunicationsGateway> {}
257+
258+
#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-interface-requires-decorator" "CheckNameAvailability is not supported by cadl-azure-resource-manager."
259+
#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-interface-uses-templates" "CheckNameAvailability is not supported by cadl-azure-resource-manager."
260+
#suppress "@azure-tools/cadl-azure-resource-manager/arm-resource-operation-missing-decorator" "CheckNameAvailability is not supported by cadl-azure-resource-manager."
261+
@added(Versions.v2023_01_31)
262+
interface NameAvailability {
263+
@doc("Check whether the resource name is available in the given region.")
264+
@post
265+
@route("/subscriptions/{subscriptionId}/providers/Microsoft.VoiceServices/locations/{location}/checkNameAvailability")
266+
checkLocal(
267+
@doc("The check availability request body.")
268+
@body
269+
body: CheckNameAvailabilityRequest,
270+
271+
@doc("The location in which uniqueness will be verified.")
272+
@path
273+
location: string,
274+
275+
...SubscriptionIdParameter,
276+
...ApiVersionParameter
277+
): CheckNameAvailabilityResponse | ErrorResponse;
278+
}

0 commit comments

Comments
 (0)