@azure-tools/typespec-azure-resource-manager 0.43.0-dev.1 → 0.43.0-dev.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -35
- package/dist/src/common-types.d.ts +13 -2
- package/dist/src/common-types.d.ts.map +1 -1
- package/dist/src/common-types.js +133 -3
- package/dist/src/common-types.js.map +1 -1
- package/dist/src/commontypes.private.decorators.d.ts +44 -0
- package/dist/src/commontypes.private.decorators.d.ts.map +1 -0
- package/dist/src/commontypes.private.decorators.js +77 -0
- package/dist/src/commontypes.private.decorators.js.map +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +17 -2
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +6 -0
- package/dist/src/lib.js.map +1 -1
- package/dist/src/namespace.d.ts.map +1 -1
- package/dist/src/namespace.js +35 -0
- package/dist/src/namespace.js.map +1 -1
- package/dist/src/private.decorators.d.ts +1 -27
- package/dist/src/private.decorators.d.ts.map +1 -1
- package/dist/src/private.decorators.js +0 -149
- package/dist/src/private.decorators.js.map +1 -1
- package/dist/src/rules/arm-common-types-version.d.ts.map +1 -1
- package/dist/src/rules/arm-common-types-version.js +2 -3
- package/dist/src/rules/arm-common-types-version.js.map +1 -1
- package/dist/src/rules/arm-post-response-codes.d.ts.map +1 -1
- package/dist/src/rules/arm-post-response-codes.js.map +1 -1
- package/dist/src/rules/core-operations.js +1 -1
- package/dist/src/rules/core-operations.js.map +1 -1
- package/dist/src/rules/missing-x-ms-identifiers.js +1 -1
- package/dist/src/rules/missing-x-ms-identifiers.js.map +1 -1
- package/lib/arm.tsp +2 -9
- package/lib/backcompat.tsp +27 -0
- package/lib/common-types/common-types.tsp +11 -1
- package/lib/common-types/commontypes.private.decorators.tsp +43 -0
- package/lib/common-types/customer-managed-keys-ref.tsp +27 -0
- package/lib/common-types/customer-managed-keys.tsp +37 -46
- package/lib/common-types/extended-location-ref.tsp +1 -0
- package/lib/common-types/extended-location.tsp +15 -16
- package/lib/common-types/internal.tsp +24 -0
- package/lib/common-types/managed-identity-ref.tsp +79 -0
- package/lib/common-types/managed-identity.tsp +50 -66
- package/lib/common-types/private-links-ref.tsp +159 -0
- package/lib/common-types/private-links.tsp +55 -102
- package/lib/common-types/types-ref.tsp +414 -0
- package/lib/common-types/types.tsp +324 -202
- package/lib/decorators.tsp +1 -1
- package/lib/{arm.foundations.tsp → foundations/arm.foundations.tsp} +28 -22
- package/lib/foundations/backcompat.tsp +39 -0
- package/lib/{common-types/backcompat.tsp → foundations/deprecation.tsp} +11 -0
- package/lib/interfaces.tsp +0 -1
- package/lib/models.tsp +25 -5
- package/lib/operations.tsp +5 -32
- package/lib/parameters.tsp +14 -67
- package/lib/private.decorators.tsp +0 -38
- package/lib/responses.tsp +8 -17
- package/package.json +5 -7
package/lib/decorators.tsp
CHANGED
|
@@ -180,7 +180,7 @@ extern dec armResourceOperations(target: Interface, _?: unknown);
|
|
|
180
180
|
* This decorator is used either on a namespace or a version enum value to indicate
|
|
181
181
|
* the version of the Azure Resource Manager common-types to use for refs in emitted Swagger files.
|
|
182
182
|
*
|
|
183
|
-
* @param version The Azure.ResourceManager.CommonTypes.Versions for the desired common-types version or an equivalent string value.
|
|
183
|
+
* @param version The Azure.ResourceManager.CommonTypes.Versions for the desired common-types version or an equivalent string value like "v5".
|
|
184
184
|
*/
|
|
185
185
|
extern dec armCommonTypesVersion(
|
|
186
186
|
target: Namespace | EnumMember,
|
|
@@ -1,30 +1,21 @@
|
|
|
1
|
+
import "@typespec/openapi";
|
|
2
|
+
import "@typespec/http";
|
|
3
|
+
import "@typespec/rest";
|
|
4
|
+
|
|
5
|
+
import "./backcompat.tsp";
|
|
6
|
+
import "./deprecation.tsp";
|
|
7
|
+
import "../common-types/common-types.tsp";
|
|
8
|
+
import "../decorators.tsp";
|
|
9
|
+
import "../responses.tsp";
|
|
10
|
+
import "../private.decorators.tsp";
|
|
11
|
+
import "../parameters.tsp";
|
|
12
|
+
|
|
1
13
|
using TypeSpec.Http;
|
|
2
14
|
using TypeSpec.OpenAPI;
|
|
3
|
-
using TypeSpec.Versioning;
|
|
4
15
|
using Azure.ResourceManager.Private;
|
|
5
16
|
|
|
6
17
|
namespace Azure.ResourceManager.Foundations;
|
|
7
18
|
|
|
8
|
-
/**
|
|
9
|
-
* An internal enum to indicate the resource support for various path types
|
|
10
|
-
*/
|
|
11
|
-
enum ResourceHome {
|
|
12
|
-
@doc("The resource is bound to a tenant")
|
|
13
|
-
Tenant,
|
|
14
|
-
|
|
15
|
-
@doc("The resource is bound to a subscription")
|
|
16
|
-
Subscription,
|
|
17
|
-
|
|
18
|
-
@doc("The resource is bound to a location")
|
|
19
|
-
Location,
|
|
20
|
-
|
|
21
|
-
@doc("The resource is bound to a resource group")
|
|
22
|
-
ResourceGroup,
|
|
23
|
-
|
|
24
|
-
@doc("The resource is bound to an extension")
|
|
25
|
-
Extension,
|
|
26
|
-
}
|
|
27
|
-
|
|
28
19
|
/**
|
|
29
20
|
* Base parameters for a resource.
|
|
30
21
|
*
|
|
@@ -53,6 +44,17 @@ model DefaultBaseParameters<Resource extends {}> {
|
|
|
53
44
|
...ResourceUriParameter;
|
|
54
45
|
}
|
|
55
46
|
|
|
47
|
+
/**
|
|
48
|
+
* Standard type definition for Azure Resource Manager Tags property.
|
|
49
|
+
*
|
|
50
|
+
* It is included in the TrackedResource template definition.
|
|
51
|
+
*/
|
|
52
|
+
/** The Azure Resource Manager Resource tags. */
|
|
53
|
+
model ArmTagsProperty {
|
|
54
|
+
/** Resource tags. */
|
|
55
|
+
tags?: Record<string>;
|
|
56
|
+
}
|
|
57
|
+
|
|
56
58
|
/**
|
|
57
59
|
* The static parameters for a tenant-based resource
|
|
58
60
|
*/
|
|
@@ -113,7 +115,11 @@ model ResourceUpdateModelProperties<
|
|
|
113
115
|
model ResourceUpdateModel<
|
|
114
116
|
Resource extends Foundations.Resource,
|
|
115
117
|
Properties extends TypeSpec.Reflection.Model
|
|
116
|
-
>
|
|
118
|
+
>
|
|
119
|
+
is OptionalProperties<UpdateableProperties<OmitProperties<
|
|
120
|
+
Resource,
|
|
121
|
+
"Name" | "name" | "properties"
|
|
122
|
+
>>> {
|
|
117
123
|
@extension("x-ms-client-flatten", true)
|
|
118
124
|
properties?: ResourceUpdateModelProperties<Resource, Properties>;
|
|
119
125
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
namespace Azure.ResourceManager.Foundations {
|
|
2
|
+
// extended-location
|
|
3
|
+
alias ExtendedLocation = CommonTypes.ExtendedLocation;
|
|
4
|
+
alias ExtendedLocationType = CommonTypes.ExtendedLocationType;
|
|
5
|
+
|
|
6
|
+
// managed-identities
|
|
7
|
+
alias ManagedServiceIdentity = CommonTypes.ManagedServiceIdentity;
|
|
8
|
+
#suppress "deprecated" "Need for back compatibility in common-types"
|
|
9
|
+
alias UserAssignedIdentities = CommonTypes.UserAssignedIdentities;
|
|
10
|
+
alias SystemAssignedServiceIdentity = CommonTypes.SystemAssignedServiceIdentity;
|
|
11
|
+
alias UserAssignedIdentity = CommonTypes.UserAssignedIdentity;
|
|
12
|
+
alias ManagedServiceIdentityType = CommonTypes.ManagedServiceIdentityType;
|
|
13
|
+
alias SystemAssignedServiceIdentityType = CommonTypes.SystemAssignedServiceIdentityType;
|
|
14
|
+
alias ManagedSystemIdentityType = SystemAssignedServiceIdentityType;
|
|
15
|
+
|
|
16
|
+
// types
|
|
17
|
+
alias Resource = CommonTypes.Resource;
|
|
18
|
+
alias AzureEntityResource = CommonTypes.AzureEntityResource;
|
|
19
|
+
alias TrackedResource = CommonTypes.TrackedResource;
|
|
20
|
+
alias ProxyResource = CommonTypes.ProxyResource;
|
|
21
|
+
alias ExtensionResource = CommonTypes.ExtensionResource;
|
|
22
|
+
alias Sku = CommonTypes.Sku;
|
|
23
|
+
alias SkuTier = CommonTypes.SkuTier;
|
|
24
|
+
alias OperationListResult = CommonTypes.OperationListResult;
|
|
25
|
+
alias Operation = CommonTypes.Operation;
|
|
26
|
+
alias OperationDisplay = CommonTypes.OperationDisplay;
|
|
27
|
+
alias OperationStatusResult = CommonTypes.OperationStatusResult;
|
|
28
|
+
alias OperationIdParameter = CommonTypes.OperationIdParameter;
|
|
29
|
+
alias ActionType = CommonTypes.ActionType;
|
|
30
|
+
alias Origin = CommonTypes.Origin;
|
|
31
|
+
alias ErrorDetail = CommonTypes.ErrorDetail;
|
|
32
|
+
alias ErrorAdditionalInfo = CommonTypes.ErrorAdditionalInfo;
|
|
33
|
+
alias SystemData = CommonTypes.SystemData;
|
|
34
|
+
alias createdByType = CommonTypes.createdByType;
|
|
35
|
+
alias Plan = CommonTypes.Plan;
|
|
36
|
+
alias CheckNameAvailabilityRequest = CommonTypes.CheckNameAvailabilityRequest;
|
|
37
|
+
alias CheckNameAvailabilityResponse = CommonTypes.CheckNameAvailabilityResponse;
|
|
38
|
+
alias CheckNameAvailabilityReason = CommonTypes.CheckNameAvailabilityReason;
|
|
39
|
+
}
|
|
@@ -17,3 +17,14 @@ alias ResourceSkuType = Sku;
|
|
|
17
17
|
|
|
18
18
|
#deprecated "Please use Foundations.Plan instead of Foundations.ResourcePlanType"
|
|
19
19
|
alias ResourcePlanType = Plan;
|
|
20
|
+
|
|
21
|
+
// managed-identity
|
|
22
|
+
#deprecated "Please change ManagedIdentityProperties to ManagedServiceIdentity."
|
|
23
|
+
alias ManagedIdentityProperties = ManagedServiceIdentity;
|
|
24
|
+
|
|
25
|
+
#deprecated "Please change ManagedSystemIdentityProperties to SystemAssignedServiceIdentity."
|
|
26
|
+
alias ManagedSystemIdentityProperties = SystemAssignedServiceIdentity;
|
|
27
|
+
|
|
28
|
+
/** Alias of ManagedServiceIdentityType for back compatability. Please change to ManagedServiceIdentityType. */
|
|
29
|
+
#deprecated "Please change to ManagedServiceIdentityType."
|
|
30
|
+
alias ManagedIdentityType = ManagedServiceIdentityType;
|
package/lib/interfaces.tsp
CHANGED
package/lib/models.tsp
CHANGED
|
@@ -11,22 +11,27 @@ namespace Azure.ResourceManager;
|
|
|
11
11
|
* Spread this model into ARM resource models to specify resource name parameter for its operations. If `Resource` parameter
|
|
12
12
|
* is specified, the resource name will be properly camel cased and pluralized for `@key` and `@segment`
|
|
13
13
|
* automatically. You can also apply explicit override with `KeyName` and `SegmentName` template parameters.
|
|
14
|
+
*
|
|
15
|
+
* For additional decorators such as @minLength, you can use either augment decorator on `[Resource].name` or passing in a scalar string type with decorators.
|
|
16
|
+
*
|
|
14
17
|
* @template Resource The ARM resource this name parameter is applying to.
|
|
15
18
|
* @template KeyName Override default key name of the resource.
|
|
16
19
|
* @template SegmentName Override default segment name of the resource.
|
|
17
20
|
* @template NamePattern The RegEx pattern of the name. Default is `^[a-zA-Z0-9-]{3,24}$`.
|
|
21
|
+
* @template Type The type of the name property. Default type is string. However you can pass an union with string values.
|
|
18
22
|
*/
|
|
19
23
|
model ResourceNameParameter<
|
|
20
24
|
Resource extends Foundations.Resource,
|
|
21
25
|
KeyName extends valueof string = "",
|
|
22
26
|
SegmentName extends valueof string = "",
|
|
23
|
-
NamePattern extends valueof string = "^[a-zA-Z0-9-]{3,24}$"
|
|
27
|
+
NamePattern extends valueof string = "^[a-zA-Z0-9-]{3,24}$",
|
|
28
|
+
Type extends string = string
|
|
24
29
|
> {
|
|
25
30
|
@doc("The name of the {name}", Resource)
|
|
26
31
|
@pattern(NamePattern)
|
|
27
32
|
@defaultResourceKeySegmentName(Resource, KeyName, SegmentName)
|
|
28
33
|
@path
|
|
29
|
-
name:
|
|
34
|
+
name: Type;
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
//#region Standard Resource Operation Interfaces
|
|
@@ -41,7 +46,6 @@ model ResourceNameParameter<
|
|
|
41
46
|
@includeInapplicableMetadataInPayload(false)
|
|
42
47
|
model TrackedResource<Properties extends {}> extends Foundations.TrackedResource {
|
|
43
48
|
@doc("The resource-specific properties for this resource.")
|
|
44
|
-
@visibility("read", "create")
|
|
45
49
|
@extension("x-ms-client-flatten", true)
|
|
46
50
|
properties?: Properties;
|
|
47
51
|
}
|
|
@@ -57,7 +61,6 @@ model TrackedResource<Properties extends {}> extends Foundations.TrackedResource
|
|
|
57
61
|
@includeInapplicableMetadataInPayload(false)
|
|
58
62
|
model ProxyResource<Properties extends {}> extends Foundations.ProxyResource {
|
|
59
63
|
@doc("The resource-specific properties for this resource.")
|
|
60
|
-
@visibility("read", "create")
|
|
61
64
|
@extension("x-ms-client-flatten", true)
|
|
62
65
|
properties?: Properties;
|
|
63
66
|
}
|
|
@@ -74,7 +77,6 @@ model ProxyResource<Properties extends {}> extends Foundations.ProxyResource {
|
|
|
74
77
|
@includeInapplicableMetadataInPayload(false)
|
|
75
78
|
model ExtensionResource<Properties extends {}> extends Foundations.ExtensionResource {
|
|
76
79
|
@doc("The resource-specific properties for this resource.")
|
|
77
|
-
@visibility("read", "create")
|
|
78
80
|
@extension("x-ms-client-flatten", true)
|
|
79
81
|
properties?: Properties;
|
|
80
82
|
}
|
|
@@ -347,4 +349,22 @@ model ManagedByProperty {
|
|
|
347
349
|
managedBy?: string;
|
|
348
350
|
}
|
|
349
351
|
|
|
352
|
+
/** Please use the spread model EncryptionProperty */
|
|
353
|
+
alias Encryption = EncryptionProperty;
|
|
354
|
+
/**
|
|
355
|
+
* Model used only to spread in the `encryption` envelope property for a resource.
|
|
356
|
+
* @example
|
|
357
|
+
*
|
|
358
|
+
* ```typespec
|
|
359
|
+
* model Foo is TrackedResource<FooProperties> {
|
|
360
|
+
* ...Encryption;
|
|
361
|
+
* }
|
|
362
|
+
* ```
|
|
363
|
+
*/
|
|
364
|
+
/** All encryption configuration for a resource. */
|
|
365
|
+
model EncryptionProperty {
|
|
366
|
+
/** All encryption configuration for a resource. */
|
|
367
|
+
encryption: EncryptionConfiguration;
|
|
368
|
+
}
|
|
369
|
+
|
|
350
370
|
//#endregion
|
package/lib/operations.tsp
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
using TypeSpec.Http;
|
|
2
2
|
using TypeSpec.Rest;
|
|
3
|
-
using TypeSpec.OpenAPI;
|
|
4
|
-
using Autorest;
|
|
5
3
|
using Azure.ResourceManager.Foundations;
|
|
6
4
|
|
|
7
5
|
namespace Azure.ResourceManager;
|
|
@@ -145,20 +143,15 @@ op ArmResourceCheckExistence<
|
|
|
145
143
|
*/
|
|
146
144
|
@autoRoute
|
|
147
145
|
@doc("Create a {name}", Resource)
|
|
148
|
-
@extension("x-ms-long-running-operation", true)
|
|
149
|
-
@extension(
|
|
150
|
-
"x-ms-long-running-operation-options",
|
|
151
|
-
{
|
|
152
|
-
`final-state-via`: "azure-async-operation",
|
|
153
|
-
}
|
|
154
|
-
)
|
|
155
146
|
@armResourceCreateOrUpdate(Resource)
|
|
156
147
|
@Private.enforceConstraint(Resource, Foundations.Resource)
|
|
148
|
+
@Azure.Core.Foundations.Private.defaultFinalStateVia(#["location", "azure-async-operation"])
|
|
157
149
|
@put
|
|
158
150
|
op ArmResourceCreateOrUpdateAsync<
|
|
159
151
|
Resource extends Foundations.Resource,
|
|
160
152
|
BaseParameters = DefaultBaseParameters<Resource>,
|
|
161
|
-
LroHeaders extends TypeSpec.Reflection.Model =
|
|
153
|
+
LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = Resource> &
|
|
154
|
+
Azure.Core.Foundations.RetryAfterHeader,
|
|
162
155
|
Parameters extends {} = {},
|
|
163
156
|
Response extends {} = ArmResourceUpdatedResponse<Resource> | ArmResourceCreatedResponse<
|
|
164
157
|
Resource,
|
|
@@ -238,7 +231,8 @@ op ArmResourceCreateOrReplaceSync<
|
|
|
238
231
|
op ArmResourceCreateOrReplaceAsync<
|
|
239
232
|
Resource extends Foundations.Resource,
|
|
240
233
|
BaseParameters = DefaultBaseParameters<Resource>,
|
|
241
|
-
LroHeaders extends TypeSpec.Reflection.Model =
|
|
234
|
+
LroHeaders extends TypeSpec.Reflection.Model = ArmAsyncOperationHeader<FinalResult = Resource> &
|
|
235
|
+
Azure.Core.Foundations.RetryAfterHeader,
|
|
242
236
|
Parameters extends {} = {},
|
|
243
237
|
Response extends {} = ArmResourceUpdatedResponse<Resource> | ArmResourceCreatedResponse<
|
|
244
238
|
Resource,
|
|
@@ -321,13 +315,6 @@ op ArmResourcePatchAsync<
|
|
|
321
315
|
*/
|
|
322
316
|
@autoRoute
|
|
323
317
|
@doc("Update a {name}", Resource)
|
|
324
|
-
@extension("x-ms-long-running-operation", true)
|
|
325
|
-
@extension(
|
|
326
|
-
"x-ms-long-running-operation-options",
|
|
327
|
-
{
|
|
328
|
-
`final-state-via`: "location",
|
|
329
|
-
}
|
|
330
|
-
)
|
|
331
318
|
@armResourceUpdate(Resource)
|
|
332
319
|
@Private.enforceConstraint(Resource, Foundations.Resource)
|
|
333
320
|
@patch
|
|
@@ -425,13 +412,6 @@ op ArmCustomPatchSync<
|
|
|
425
412
|
*/
|
|
426
413
|
@autoRoute
|
|
427
414
|
@doc("Delete a {name}", Resource)
|
|
428
|
-
@extension("x-ms-long-running-operation", true)
|
|
429
|
-
@extension(
|
|
430
|
-
"x-ms-long-running-operation-options",
|
|
431
|
-
{
|
|
432
|
-
`final-state-via`: "location",
|
|
433
|
-
}
|
|
434
|
-
)
|
|
435
415
|
@armResourceDelete(Resource)
|
|
436
416
|
@Private.enforceConstraint(Resource, Foundations.Resource)
|
|
437
417
|
@delete
|
|
@@ -515,13 +495,6 @@ op ArmResourceDeleteSync<
|
|
|
515
495
|
* @template Error Optional. The error response, if non-standard.
|
|
516
496
|
*/
|
|
517
497
|
@autoRoute
|
|
518
|
-
@extension("x-ms-long-running-operation", true)
|
|
519
|
-
@extension(
|
|
520
|
-
"x-ms-long-running-operation-options",
|
|
521
|
-
{
|
|
522
|
-
`final-state-via`: "location",
|
|
523
|
-
}
|
|
524
|
-
)
|
|
525
498
|
@armResourceAction(Resource)
|
|
526
499
|
@Private.enforceConstraint(Resource, Foundations.Resource)
|
|
527
500
|
@post
|
package/lib/parameters.tsp
CHANGED
|
@@ -3,80 +3,45 @@ using TypeSpec.Rest;
|
|
|
3
3
|
using TypeSpec.OpenAPI;
|
|
4
4
|
using Azure.ResourceManager.Foundations;
|
|
5
5
|
using Azure.ResourceManager.Private;
|
|
6
|
+
using Azure.ResourceManager.CommonTypes;
|
|
7
|
+
using Azure.ResourceManager.CommonTypes.Private;
|
|
6
8
|
|
|
7
9
|
namespace Azure.ResourceManager;
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* The default api-version parameter type.
|
|
11
13
|
*/
|
|
12
|
-
|
|
13
|
-
model ApiVersionParameter {
|
|
14
|
-
@query("api-version")
|
|
15
|
-
@minLength(1)
|
|
16
|
-
@doc("The API version to use for this operation.")
|
|
17
|
-
@armCommonParameter("ApiVersionParameter", Azure.ResourceManager.CommonTypes.Versions.v3)
|
|
18
|
-
@armCommonParameter("ApiVersionParameter", Azure.ResourceManager.CommonTypes.Versions.v4)
|
|
19
|
-
@armCommonParameter("ApiVersionParameter", Azure.ResourceManager.CommonTypes.Versions.v5)
|
|
20
|
-
@resourceParameterBaseFor(
|
|
21
|
-
[
|
|
22
|
-
ResourceHome.ResourceGroup,
|
|
23
|
-
ResourceHome.Subscription,
|
|
24
|
-
ResourceHome.Location,
|
|
25
|
-
ResourceHome.Tenant,
|
|
26
|
-
ResourceHome.Extension
|
|
27
|
-
]
|
|
28
|
-
)
|
|
29
|
-
apiVersion: string;
|
|
30
|
-
}
|
|
14
|
+
alias ApiVersionParameter = CommonTypes.ApiVersionParameter;
|
|
31
15
|
|
|
32
16
|
/**
|
|
33
17
|
* The default subscriptionId parameter type.
|
|
34
18
|
*/
|
|
35
|
-
|
|
36
|
-
model SubscriptionIdParameter {
|
|
37
|
-
@path
|
|
38
|
-
@minLength(1)
|
|
39
|
-
@segment("subscriptions")
|
|
40
|
-
@doc("The ID of the target subscription.")
|
|
41
|
-
@armCommonParameter("SubscriptionIdParameter", Azure.ResourceManager.CommonTypes.Versions.v3)
|
|
42
|
-
@armCommonParameter("SubscriptionIdParameter", Azure.ResourceManager.CommonTypes.Versions.v4)
|
|
43
|
-
@armCommonParameter("SubscriptionIdParameter", Azure.ResourceManager.CommonTypes.Versions.v5)
|
|
44
|
-
@resourceParameterBaseFor(
|
|
45
|
-
[ResourceHome.ResourceGroup, ResourceHome.Subscription, ResourceHome.Location]
|
|
46
|
-
)
|
|
47
|
-
subscriptionId: string;
|
|
48
|
-
}
|
|
19
|
+
alias SubscriptionIdParameter = CommonTypes.SubscriptionIdParameter;
|
|
49
20
|
|
|
50
21
|
/**
|
|
51
|
-
*
|
|
52
|
-
* The default location parameter type.
|
|
22
|
+
* The default ResourceGroup parameter type.
|
|
53
23
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
@armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v3)
|
|
61
|
-
@armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v4)
|
|
62
|
-
@armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v5)
|
|
63
|
-
@resourceParameterBaseFor([ResourceHome.Location])
|
|
64
|
-
location: string;
|
|
65
|
-
}
|
|
24
|
+
alias ResourceGroupParameter = CommonTypes.ResourceGroupNameParameter;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The default LocationResource parameter type.
|
|
28
|
+
*/
|
|
29
|
+
alias LocationResourceParameter = CommonTypes.LocationResourceParameter;
|
|
66
30
|
|
|
67
31
|
/**
|
|
32
|
+
* DEPRECATED - DO NOT USE
|
|
68
33
|
* The default location parameter type.
|
|
69
34
|
*/
|
|
70
35
|
@doc("The default location parameter type.")
|
|
71
|
-
model
|
|
36
|
+
model LocationParameter {
|
|
72
37
|
@path
|
|
73
38
|
@minLength(1)
|
|
74
39
|
@segment("locations")
|
|
75
40
|
@doc("The location name.")
|
|
76
|
-
@key
|
|
77
41
|
@armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v3)
|
|
78
42
|
@armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v4)
|
|
79
43
|
@armCommonParameter("LocationParameter", Azure.ResourceManager.CommonTypes.Versions.v5)
|
|
44
|
+
@resourceParameterBaseFor([ResourceHome.Location])
|
|
80
45
|
location: string;
|
|
81
46
|
}
|
|
82
47
|
|
|
@@ -113,24 +78,6 @@ model ArmLocationResource<BaseType extends
|
|
|
113
78
|
...LocationResourceParameter;
|
|
114
79
|
}
|
|
115
80
|
|
|
116
|
-
/**
|
|
117
|
-
* The default resource group parameter type.
|
|
118
|
-
*/
|
|
119
|
-
@doc("The default resource group parameter type.")
|
|
120
|
-
model ResourceGroupParameter {
|
|
121
|
-
@path
|
|
122
|
-
@minLength(1)
|
|
123
|
-
@maxLength(90)
|
|
124
|
-
@segment("resourceGroups")
|
|
125
|
-
@pattern("^[-\\w\\._\\(\\)]+$")
|
|
126
|
-
@doc("The name of the resource group. The name is case insensitive.")
|
|
127
|
-
@armCommonParameter("ResourceGroupNameParameter", Azure.ResourceManager.CommonTypes.Versions.v3)
|
|
128
|
-
@armCommonParameter("ResourceGroupNameParameter", Azure.ResourceManager.CommonTypes.Versions.v4)
|
|
129
|
-
@armCommonParameter("ResourceGroupNameParameter", Azure.ResourceManager.CommonTypes.Versions.v5)
|
|
130
|
-
@resourceParameterBaseFor([ResourceHome.ResourceGroup])
|
|
131
|
-
resourceGroupName: string;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
81
|
/**
|
|
135
82
|
* The default resourceUri parameter type.
|
|
136
83
|
*/
|
|
@@ -14,39 +14,6 @@ extern dec armUpdateProviderNamespace(target: Reflection.Operation);
|
|
|
14
14
|
*/
|
|
15
15
|
extern dec assignProviderNameValue(target: ModelProperty, resource: Model);
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
* Describes the shape of model literals accepted by the `version` parameter of
|
|
19
|
-
* the `armCommonDefinition` and `armCommonParameter` decorators.
|
|
20
|
-
*/
|
|
21
|
-
alias ArmCommonTypeVersionSpec = {
|
|
22
|
-
version: string | EnumMember;
|
|
23
|
-
isDefault: boolean;
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @param definitionName Definition name
|
|
28
|
-
* @param version Azure Resource Manager Version
|
|
29
|
-
* @param referenceFile Reference file
|
|
30
|
-
*/
|
|
31
|
-
extern dec armCommonDefinition(
|
|
32
|
-
target: Model,
|
|
33
|
-
definitionName?: valueof string,
|
|
34
|
-
version?: valueof EnumMember | ArmCommonTypeVersionSpec | string,
|
|
35
|
-
referenceFile?: valueof string
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @param definitionName Definition name
|
|
40
|
-
* @param version Azure Resource Manager Version
|
|
41
|
-
* @param referenceFile Reference file
|
|
42
|
-
*/
|
|
43
|
-
extern dec armCommonParameter(
|
|
44
|
-
target: ModelProperty,
|
|
45
|
-
definitionName?: valueof string,
|
|
46
|
-
version?: valueof EnumMember | ArmCommonTypeVersionSpec | string,
|
|
47
|
-
referenceFile?: valueof string
|
|
48
|
-
);
|
|
49
|
-
|
|
50
17
|
/**
|
|
51
18
|
* This decorator is used to identify Azure Resource Manager resource types and extract their
|
|
52
19
|
* metadata. It is *not* meant to be used directly by a spec author, it instead
|
|
@@ -78,11 +45,6 @@ extern dec resourceBaseParametersOf(target: Model, propertyName: Model);
|
|
|
78
45
|
*/
|
|
79
46
|
extern dec resourceParameterBaseFor(target: ModelProperty, values: unknown[]);
|
|
80
47
|
|
|
81
|
-
/**
|
|
82
|
-
* Marks an enum as representing the valid `common-types` versions.
|
|
83
|
-
*/
|
|
84
|
-
extern dec armCommonTypesVersions(target: Enum);
|
|
85
|
-
|
|
86
48
|
/**
|
|
87
49
|
* Provides default name decoration on resource name property with
|
|
88
50
|
* camelcased and pluralized key and segment name
|
package/lib/responses.tsp
CHANGED
|
@@ -3,6 +3,7 @@ using TypeSpec.Rest;
|
|
|
3
3
|
using TypeSpec.OpenAPI;
|
|
4
4
|
using Azure.ResourceManager.Foundations;
|
|
5
5
|
using Azure.ResourceManager.Private;
|
|
6
|
+
using Azure.ResourceManager.CommonTypes.Private;
|
|
6
7
|
|
|
7
8
|
namespace Azure.ResourceManager;
|
|
8
9
|
|
|
@@ -131,15 +132,18 @@ model ArmOperationStatus<
|
|
|
131
132
|
/**
|
|
132
133
|
* The standard header for asynchronous operation polling
|
|
133
134
|
* @template StatusMonitor The status monitor type for lro polling
|
|
134
|
-
* @template UrlValue The value type of the Azure-AsyncOperation
|
|
135
|
+
* @template UrlValue The value type of the Azure-AsyncOperation header
|
|
136
|
+
* @template FinalResult The logical final result of the operation
|
|
135
137
|
*/
|
|
136
138
|
model ArmAsyncOperationHeader<
|
|
137
139
|
StatusMonitor extends {} = ArmOperationStatus,
|
|
138
|
-
UrlValue extends string = string
|
|
140
|
+
UrlValue extends string = string,
|
|
141
|
+
FinalResult extends {} = never
|
|
139
142
|
> {
|
|
140
143
|
/** A link to the status monitor */
|
|
141
144
|
@header("Azure-AsyncOperation")
|
|
142
|
-
@Azure.Core.pollingLocation(Azure.Core.StatusMonitorPollingOptions<StatusMonitor>)
|
|
145
|
+
@Azure.Core.pollingLocation(Azure.Core.StatusMonitorPollingOptions<PollingModel = StatusMonitor>)
|
|
146
|
+
@Azure.Core.finalLocation(FinalResult)
|
|
143
147
|
azureAsyncOperation?: UrlValue;
|
|
144
148
|
}
|
|
145
149
|
|
|
@@ -150,7 +154,7 @@ model ArmAsyncOperationHeader<
|
|
|
150
154
|
* @template UrlValue The value type for the location header
|
|
151
155
|
*/
|
|
152
156
|
model ArmLroLocationHeader<
|
|
153
|
-
LroPollingOptions extends Azure.Core.PollingOptions = Azure.Core.StatusMonitorPollingOptions<ArmOperationStatus>,
|
|
157
|
+
LroPollingOptions extends Azure.Core.PollingOptions = Azure.Core.StatusMonitorPollingOptions<PollingModel = ArmOperationStatus>,
|
|
154
158
|
FinalResult extends {} | void = void,
|
|
155
159
|
UrlValue extends string = string
|
|
156
160
|
> {
|
|
@@ -239,19 +243,6 @@ model ArmResourceCreatedSyncResponse<Resource extends Azure.ResourceManager.Foun
|
|
|
239
243
|
body: Resource;
|
|
240
244
|
}
|
|
241
245
|
|
|
242
|
-
/**
|
|
243
|
-
* The standard Azure Resource Manager error response
|
|
244
|
-
*/
|
|
245
|
-
@error
|
|
246
|
-
@armCommonDefinition("ErrorResponse", Azure.ResourceManager.CommonTypes.Versions.v3)
|
|
247
|
-
@armCommonDefinition("ErrorResponse", Azure.ResourceManager.CommonTypes.Versions.v4)
|
|
248
|
-
@armCommonDefinition("ErrorResponse", Azure.ResourceManager.CommonTypes.Versions.v5)
|
|
249
|
-
@doc("Common error response for all Azure Resource Manager APIs to return error details for failed operations.")
|
|
250
|
-
model ErrorResponse {
|
|
251
|
-
@doc("The error object.")
|
|
252
|
-
error?: ErrorDetail;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
246
|
/**
|
|
256
247
|
* @dev Resource exists response
|
|
257
248
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azure-tools/typespec-azure-resource-manager",
|
|
3
|
-
"version": "0.43.0-dev.
|
|
3
|
+
"version": "0.43.0-dev.11",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec Azure Resource Manager library",
|
|
6
6
|
"homepage": "https://azure.github.io/typespec-azure",
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"pluralize": "^8.0.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"@azure-tools/typespec-autorest": "~0.42.0 || >=0.43.0-dev <0.43.0",
|
|
47
46
|
"@azure-tools/typespec-azure-core": "~0.42.0 || >=0.43.0-dev <0.43.0",
|
|
48
47
|
"@typespec/compiler": "~0.56.0 || >=0.57.0-dev <0.57.0",
|
|
49
48
|
"@typespec/http": "~0.56.0 || >=0.57.0-dev <0.57.0",
|
|
@@ -52,7 +51,6 @@
|
|
|
52
51
|
"@typespec/versioning": "~0.56.0 || >=0.57.0-dev <0.57.0"
|
|
53
52
|
},
|
|
54
53
|
"devDependencies": {
|
|
55
|
-
"@azure-tools/typespec-autorest": "~0.42.0 || >=0.43.0-dev <0.43.0",
|
|
56
54
|
"@azure-tools/typespec-azure-core": "~0.42.0 || >=0.43.0-dev <0.43.0",
|
|
57
55
|
"@types/node": "~18.11.19",
|
|
58
56
|
"@types/pluralize": "^0.0.33",
|
|
@@ -62,12 +60,12 @@
|
|
|
62
60
|
"@typespec/openapi": "~0.56.0 || >=0.57.0-dev <0.57.0",
|
|
63
61
|
"@typespec/rest": "~0.56.0 || >=0.57.0-dev <0.57.0",
|
|
64
62
|
"@typespec/versioning": "~0.56.0 || >=0.57.0-dev <0.57.0",
|
|
65
|
-
"@vitest/coverage-v8": "^1.
|
|
66
|
-
"@vitest/ui": "^1.
|
|
63
|
+
"@vitest/coverage-v8": "^1.6.0",
|
|
64
|
+
"@vitest/ui": "^1.6.0",
|
|
67
65
|
"c8": "^9.1.0",
|
|
68
|
-
"rimraf": "~5.0.
|
|
66
|
+
"rimraf": "~5.0.7",
|
|
69
67
|
"typescript": "~5.4.5",
|
|
70
|
-
"vitest": "^1.
|
|
68
|
+
"vitest": "^1.6.0",
|
|
71
69
|
"@typespec/tspd": "~0.46.0"
|
|
72
70
|
},
|
|
73
71
|
"scripts": {
|