@azure-tools/typespec-azure-resource-manager 0.43.0-dev.8 → 0.43.0-dev.9
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/lib/models.tsp +7 -2
- package/package.json +1 -1
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
|
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.9",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec Azure Resource Manager library",
|
|
6
6
|
"homepage": "https://azure.github.io/typespec-azure",
|