@@ -160,6 +160,58 @@ it("can use private endpoints with common-types references", async () => {
160
160
ok ( openapi . paths [ privateEndpointGet ] . get . parameters [ 1 ] ) ;
161
161
} ) ;
162
162
163
+ it ( "verify resolution of private endpoints and private links with v5 version" , async ( ) => {
164
+ const openapi = await openApiFor (
165
+ `@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
166
+ @armProviderNamespace
167
+ @armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v5)
168
+ namespace Microsoft.PrivateLinkTest;
169
+
170
+ interface Operations extends Azure.ResourceManager.Operations {}
171
+
172
+ @tenantResource
173
+ model PrivateEndpointConnectionResource is ProxyResource<PrivateEndpointConnectionProperties> {
174
+ @path
175
+ @segment("privateEndpointConnections")
176
+ @key("privateEndpointConnectionName")
177
+ name: string;
178
+ }
179
+
180
+ @armResourceOperations(PrivateEndpointConnectionResource)
181
+ interface PrivateEndpointConnections {
182
+ #suppress "deprecated" "PrivateLinkResourceListResultV5 validation"
183
+ listConnections is ArmResourceListByParent<PrivateEndpointConnectionResource,
184
+ Response = ArmResponse<Azure.ResourceManager.CommonTypes.PrivateEndpointConnectionListResultV5>>;
185
+ }
186
+
187
+ model PrivateLinkResource is ProxyResource<PrivateLinkResourceProperties> {
188
+ ...PrivateLinkResourceParameter;
189
+ }
190
+
191
+ @armResourceOperations(PrivateLinkResource)
192
+ interface PrivateLinkResources {
193
+ #suppress "deprecated" "PrivateLinkResourceListResultV5 validation"
194
+ listByLinkResult is ArmResourceListByParent< PrivateLinkResource,
195
+ Response = ArmResponse<Azure.ResourceManager.CommonTypes.PrivateLinkResourceListResultV5>
196
+ >;
197
+ }
198
+ ` ,
199
+ ) ;
200
+
201
+ const privateEndpointList = "/providers/Microsoft.PrivateLinkTest/privateEndpointConnections" ;
202
+ const privateLinkList =
203
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PrivateLinkTest/privateLinkResources" ;
204
+
205
+ deepStrictEqual (
206
+ openapi . paths [ privateEndpointList ] . get . responses [ "200" ] . schema [ "$ref" ] ,
207
+ "../../common-types/resource-management/v5/privatelinks.json#/definitions/PrivateEndpointConnectionListResult" ,
208
+ ) ;
209
+ deepStrictEqual (
210
+ openapi . paths [ privateLinkList ] . get . responses [ "200" ] . schema [ "$ref" ] ,
211
+ "../../common-types/resource-management/v5/privatelinks.json#/definitions/PrivateLinkResourceListResult" ,
212
+ ) ;
213
+ } ) ;
214
+
163
215
it ( "can use ResourceNameParameter for custom name parameter definition" , async ( ) => {
164
216
const openapi = await openApiFor (
165
217
`@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
0 commit comments