@azure-tools/typespec-azure-resource-manager 0.42.0-dev.10 → 0.42.0-dev.12

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.
@@ -0,0 +1,118 @@
1
+ using Azure.ResourceManager.Private;
2
+
3
+ namespace Azure.ResourceManager.Foundations;
4
+
5
+ /**
6
+ * The properties of the managed service identities assigned to this resource.
7
+ */
8
+ @armCommonDefinition(
9
+ "ManagedServiceIdentity",
10
+ {
11
+ version: Azure.ResourceManager.CommonTypes.Versions.v4,
12
+ isDefault: true,
13
+ },
14
+ "managedidentity.json"
15
+ )
16
+ @armCommonDefinition(
17
+ "ManagedServiceIdentity",
18
+ Azure.ResourceManager.CommonTypes.Versions.v5,
19
+ "managedidentity.json"
20
+ )
21
+ @doc("The properties of the managed service identities assigned to this resource.")
22
+ model ManagedIdentityProperties {
23
+ @doc("The Active Directory tenant id of the principal.")
24
+ @visibility("read")
25
+ tenantId?: string;
26
+
27
+ @doc("The active directory identifier of this principal.")
28
+ @visibility("read")
29
+ principalId?: string;
30
+
31
+ @doc("The type of managed identity assigned to this resource.")
32
+ type: ManagedServiceIdentityType;
33
+
34
+ @doc("The identities assigned to this resource by the user.")
35
+ userAssignedIdentities?: Record<UserAssignedIdentity>;
36
+ }
37
+
38
+ /**
39
+ * The properties of the service-assigned identity associated with this resource.
40
+ */
41
+ @armCommonDefinition(
42
+ "SystemAssignedServiceIdentity",
43
+ {
44
+ version: Azure.ResourceManager.CommonTypes.Versions.v4,
45
+ isDefault: true,
46
+ },
47
+ "managedidentity.json"
48
+ )
49
+ @armCommonDefinition(
50
+ "SystemAssignedServiceIdentity",
51
+ Azure.ResourceManager.CommonTypes.Versions.v5,
52
+ "managedidentity.json"
53
+ )
54
+ @doc("The properties of the service-assigned identity associated with this resource.")
55
+ model ManagedSystemIdentityProperties {
56
+ @doc("The Active Directory tenant id of the principal.")
57
+ @visibility("read")
58
+ tenantId?: string;
59
+
60
+ @doc("The active directory identifier of this principal.")
61
+ @visibility("read")
62
+ principalId?: string;
63
+
64
+ @doc("The type of managed identity assigned to this resource.")
65
+ type: SystemAssignedServiceIdentityType;
66
+ }
67
+
68
+ /** Alias of ManagedServiceIdentityType for back compatability. Please change to ManagedServiceIdentityType. */
69
+ #deprecated "Please change to ManagedServiceIdentityType."
70
+ alias ManagedIdentityType = ManagedServiceIdentityType;
71
+ /**
72
+ * A managed identity assigned by the user.
73
+ */
74
+ @doc("A managed identity assigned by the user.")
75
+ model UserAssignedIdentity {
76
+ @doc("The active directory client identifier for this principal.")
77
+ clientId?: string;
78
+
79
+ @doc("The active directory identifier for this principal.")
80
+ principalId?: string;
81
+ }
82
+
83
+ /**
84
+ * The kind of managed identity assigned to this resource.
85
+ */
86
+ @doc("The kind of managed identity assigned to this resource.")
87
+ union ManagedServiceIdentityType {
88
+ @doc("No managed identity.")
89
+ None: "None",
90
+
91
+ @doc("System assigned managed identity.")
92
+ SystemAssigned: "SystemAssigned",
93
+
94
+ @doc("User assigned managed identity.")
95
+ UserAssigned: "UserAssigned",
96
+
97
+ @doc("System and user assigned managed identity.")
98
+ SystemAndUserAssigned: "SystemAssigned, UserAssigned",
99
+
100
+ string,
101
+ }
102
+
103
+ /** Alias of SystemAssignedServiceIdentityType for back compatability. Please change to SystemAssignedServiceIdentityType. */
104
+ alias ManagedSystemIdentityType = SystemAssignedServiceIdentityType;
105
+
106
+ /**
107
+ * The kind of managemed identity assigned to this resource.
108
+ */
109
+ @doc("The kind of managemed identity assigned to this resource.")
110
+ union SystemAssignedServiceIdentityType {
111
+ @doc("No managed system identity.")
112
+ None: "None",
113
+
114
+ @doc("System assigned managed system identity.")
115
+ SystemAssigned: "SystemAssigned",
116
+
117
+ string,
118
+ }
@@ -0,0 +1,444 @@
1
+ using TypeSpec.Http;
2
+ using TypeSpec.OpenAPI;
3
+ using Azure.ResourceManager.Private;
4
+
5
+ namespace Azure.ResourceManager.Foundations;
6
+
7
+ /** Base class used for type definitions */
8
+ model ArmResourceBase {}
9
+
10
+ /**
11
+ * Base model that defines common properties for all Azure Resource Manager resources.
12
+ */
13
+ @doc("Common properties for all Azure Resource Manager resources.")
14
+ model ArmResource extends ArmResourceBase {
15
+ @doc("Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}")
16
+ @visibility("read")
17
+ id: string;
18
+
19
+ @doc("The name of the resource")
20
+ @visibility("read")
21
+ name: string;
22
+
23
+ @doc("The type of the resource. E.g. \"Microsoft.Compute/virtualMachines\" or \"Microsoft.Storage/storageAccounts\"")
24
+ @visibility("read")
25
+ type: string;
26
+
27
+ @doc("Azure Resource Manager metadata containing createdBy and modifiedBy information.")
28
+ @visibility("read")
29
+ systemData?: SystemData;
30
+ }
31
+
32
+ /**
33
+ * Standard type definition for Azure Resource Manager Tags property.
34
+ *
35
+ * It is included in the TrackedResource template definition.
36
+ */
37
+ @doc("The Azure Resource Manager Resource tags.")
38
+ model ArmTagsProperty {
39
+ @doc("Resource tags.")
40
+ tags?: Record<string>;
41
+ }
42
+
43
+ /**
44
+ * The base tracked resource.
45
+ */
46
+ @armCommonDefinition("TrackedResource", Azure.ResourceManager.CommonTypes.Versions.v3)
47
+ @armCommonDefinition("TrackedResource", Azure.ResourceManager.CommonTypes.Versions.v4)
48
+ @armCommonDefinition("TrackedResource", Azure.ResourceManager.CommonTypes.Versions.v5)
49
+ @doc("The resource model definition for an Azure Resource Manager tracked top level resource")
50
+ model TrackedResourceBase extends ArmResource {
51
+ @doc("The geo-location where the resource lives")
52
+ @visibility("read", "create")
53
+ location: string;
54
+
55
+ ...ArmTagsProperty;
56
+ }
57
+
58
+ /**
59
+ * The base proxy resource.
60
+ */
61
+ @doc("The base proxy resource.")
62
+ @armCommonDefinition("ProxyResource", Azure.ResourceManager.CommonTypes.Versions.v3)
63
+ @armCommonDefinition("ProxyResource", Azure.ResourceManager.CommonTypes.Versions.v4)
64
+ @armCommonDefinition("ProxyResource", Azure.ResourceManager.CommonTypes.Versions.v5)
65
+ model ProxyResourceBase extends ArmResource {}
66
+
67
+ /**
68
+ * The base extension resource.
69
+ */
70
+ // Note that ProxyResource is the base definition for both kinds of resources
71
+ @doc("The base extension resource.")
72
+ @armCommonDefinition("ProxyResource", Azure.ResourceManager.CommonTypes.Versions.v3)
73
+ @armCommonDefinition("ProxyResource", Azure.ResourceManager.CommonTypes.Versions.v4)
74
+ @armCommonDefinition("ProxyResource", Azure.ResourceManager.CommonTypes.Versions.v5)
75
+ model ExtensionResourceBase extends ArmResource {}
76
+
77
+ /**
78
+ * The SKU (Stock Keeping Unit) assigned to this resource.
79
+ */
80
+ @doc("The SKU (Stock Keeping Unit) assigned to this resource.")
81
+ @armCommonDefinition("Sku", Azure.ResourceManager.CommonTypes.Versions.v3)
82
+ @armCommonDefinition("Sku", Azure.ResourceManager.CommonTypes.Versions.v4)
83
+ @armCommonDefinition("Sku", Azure.ResourceManager.CommonTypes.Versions.v5)
84
+ model ResourceSkuType {
85
+ @doc("The name of the SKU, usually a combination of letters and numbers, for example, 'P3'")
86
+ name: string;
87
+
88
+ @doc("This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.")
89
+ tier?: SkuTier;
90
+
91
+ @doc("The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code.")
92
+ size?: string;
93
+
94
+ @doc("If the service has different generations of hardware, for the same SKU, then that can be captured here.")
95
+ family?: string;
96
+
97
+ @doc("If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted.")
98
+ capacity?: int32;
99
+ }
100
+
101
+ /**
102
+ * Available service tiers for the SKU.
103
+ */
104
+ @doc("Available service tiers for the SKU.")
105
+ enum SkuTier {
106
+ @doc("The Free service tier.")
107
+ Free,
108
+
109
+ @doc("The Basic service tier.")
110
+ Basic,
111
+
112
+ @doc("The Standard service tier.")
113
+ Standard,
114
+
115
+ @doc("The Premium service tier.")
116
+ Premium,
117
+ }
118
+
119
+ /**
120
+ * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
121
+ */
122
+ @armCommonDefinition("OperationListResult", Azure.ResourceManager.CommonTypes.Versions.v3)
123
+ @armCommonDefinition("OperationListResult", Azure.ResourceManager.CommonTypes.Versions.v4)
124
+ @armCommonDefinition("OperationListResult", Azure.ResourceManager.CommonTypes.Versions.v5)
125
+ @doc("""
126
+ A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results.
127
+ """)
128
+ model OperationListResult is Azure.Core.Page<Operation>;
129
+
130
+ /**
131
+ * Details of a REST API operation, returned from the Resource Provider Operations API
132
+ */
133
+ @armCommonDefinition("Operation", Azure.ResourceManager.CommonTypes.Versions.v3)
134
+ @armCommonDefinition("Operation", Azure.ResourceManager.CommonTypes.Versions.v4)
135
+ @armCommonDefinition("Operation", Azure.ResourceManager.CommonTypes.Versions.v5)
136
+ @doc("Details of a REST API operation, returned from the Resource Provider Operations API")
137
+ model Operation {
138
+ @doc("""
139
+ The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
140
+ """)
141
+ @visibility("read")
142
+ name?: string;
143
+
144
+ @doc("""
145
+ Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations.
146
+ """)
147
+ @visibility("read")
148
+ isDataAction?: boolean;
149
+
150
+ @doc("Localized display information for this particular operation.")
151
+ display?: OperationDisplay;
152
+
153
+ @doc("""
154
+ The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
155
+ """)
156
+ @visibility("read")
157
+ origin?: Origin;
158
+
159
+ @doc("""
160
+ Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
161
+ """)
162
+ actionType?: ActionType;
163
+ }
164
+
165
+ /**
166
+ * Localized display information for and operation.
167
+ */
168
+ @armCommonDefinition("OperationDisplay", Azure.ResourceManager.CommonTypes.Versions.v3)
169
+ @armCommonDefinition("OperationDisplay", Azure.ResourceManager.CommonTypes.Versions.v4)
170
+ @armCommonDefinition("OperationDisplay", Azure.ResourceManager.CommonTypes.Versions.v5)
171
+ @doc("Localized display information for and operation.")
172
+ model OperationDisplay {
173
+ @doc("""
174
+ The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute".
175
+ """)
176
+ provider?: string;
177
+
178
+ @doc("""
179
+ The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections".
180
+ """)
181
+ resource?: string;
182
+
183
+ @doc("""
184
+ The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine".
185
+ """)
186
+ operation?: string;
187
+
188
+ @doc("The short, localized friendly description of the operation; suitable for tool tips and detailed views.")
189
+ description?: string;
190
+ }
191
+
192
+ /**
193
+ * The current status of an async operation.
194
+ */
195
+ @armCommonDefinition("OperationStatusResult", Azure.ResourceManager.CommonTypes.Versions.v3)
196
+ @armCommonDefinition("OperationStatusResult", Azure.ResourceManager.CommonTypes.Versions.v4)
197
+ @armCommonDefinition("OperationStatusResult", Azure.ResourceManager.CommonTypes.Versions.v5)
198
+ @doc("The current status of an async operation.")
199
+ model OperationStatusResult {
200
+ @doc("Fully qualified ID for the async operation.")
201
+ id?: string;
202
+
203
+ @doc("Name of the async operation.")
204
+ name?: string;
205
+
206
+ @doc("Operation status.")
207
+ status: string;
208
+
209
+ @doc("Percent of the operation that is complete.")
210
+ @minValue(0)
211
+ @maxValue(100)
212
+ percentComplete?: int32;
213
+
214
+ @doc("The start time of the operation.")
215
+ startTime?: utcDateTime;
216
+
217
+ @doc("The end time of the operation.")
218
+ endTime?: utcDateTime;
219
+
220
+ @doc("The operations list.")
221
+ operations: OperationStatusResult[];
222
+
223
+ @doc("If present, details of the operation error.")
224
+ error?: ErrorDetail;
225
+ }
226
+
227
+ /**
228
+ * The default operationId parameter type.
229
+ */
230
+ @doc("The default operationId parameter type.")
231
+ model OperationIdParameter {
232
+ @path
233
+ @minLength(1)
234
+ @doc("The ID of an ongoing async operation.")
235
+ @armCommonParameter("OperationIdParameter", Azure.ResourceManager.CommonTypes.Versions.v3)
236
+ @armCommonParameter("OperationIdParameter", Azure.ResourceManager.CommonTypes.Versions.v4)
237
+ @armCommonParameter("OperationIdParameter", Azure.ResourceManager.CommonTypes.Versions.v5)
238
+ operationId: string;
239
+ }
240
+
241
+ /**
242
+ * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
243
+ */
244
+ @doc("""
245
+ Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
246
+ """)
247
+ union ActionType {
248
+ @doc("Actions are for internal-only APIs.")
249
+ Internal: "Internal",
250
+
251
+ string,
252
+ }
253
+
254
+ /**
255
+ * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
256
+ */
257
+ @doc("""
258
+ The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
259
+ """)
260
+ union Origin {
261
+ @doc("Indicates the operation is initiated by a user.")
262
+ user: "user",
263
+
264
+ @doc("Indicates the operation is initiated by a system.")
265
+ system: "system",
266
+
267
+ @doc("Indicates the operation is initiated by a user or system.")
268
+ `user,system`: "user,system",
269
+
270
+ string,
271
+ }
272
+
273
+ /**
274
+ * The error detail.
275
+ */
276
+ @armCommonDefinition("ErrorDetail", Azure.ResourceManager.CommonTypes.Versions.v3)
277
+ @armCommonDefinition("ErrorDetail", Azure.ResourceManager.CommonTypes.Versions.v4)
278
+ @armCommonDefinition("ErrorDetail", Azure.ResourceManager.CommonTypes.Versions.v5)
279
+ @doc("The error detail.")
280
+ model ErrorDetail {
281
+ @doc("The error code.")
282
+ @visibility("read")
283
+ code?: string;
284
+
285
+ @doc("The error message.")
286
+ @visibility("read")
287
+ message?: string;
288
+
289
+ @doc("The error target.")
290
+ @visibility("read")
291
+ target?: string;
292
+
293
+ @extension("x-ms-identifiers", ["message", "target"])
294
+ @doc("The error details.")
295
+ @visibility("read")
296
+ details?: ErrorDetail[];
297
+
298
+ @extension("x-ms-identifiers", ["message", "target"])
299
+ @doc("The error additional info.")
300
+ @visibility("read")
301
+ additionalInfo?: ErrorAdditionalInfo[];
302
+ }
303
+
304
+ /**
305
+ * The resource management error additional info.
306
+ */
307
+ @armCommonDefinition("ErrorAdditionalInfo", Azure.ResourceManager.CommonTypes.Versions.v3)
308
+ @armCommonDefinition("ErrorAdditionalInfo", Azure.ResourceManager.CommonTypes.Versions.v4)
309
+ @armCommonDefinition("ErrorAdditionalInfo", Azure.ResourceManager.CommonTypes.Versions.v5)
310
+ @doc("The resource management error additional info.")
311
+ model ErrorAdditionalInfo {
312
+ @doc("The additional info type.")
313
+ @visibility("read")
314
+ type?: string;
315
+
316
+ @doc("The additional info.")
317
+ @visibility("read")
318
+ info?: {};
319
+ }
320
+
321
+ /**
322
+ * Metadata pertaining to creation and last modification of the resource.
323
+ */
324
+ @armCommonDefinition("systemData", Azure.ResourceManager.CommonTypes.Versions.v3)
325
+ @armCommonDefinition("systemData", Azure.ResourceManager.CommonTypes.Versions.v4)
326
+ @armCommonDefinition("systemData", Azure.ResourceManager.CommonTypes.Versions.v5)
327
+ @doc("Metadata pertaining to creation and last modification of the resource.")
328
+ model SystemData {
329
+ @visibility("read")
330
+ @doc("The identity that created the resource.")
331
+ createdBy?: string;
332
+
333
+ @visibility("read")
334
+ @doc("The type of identity that created the resource.")
335
+ createdByType?: createdByType;
336
+
337
+ @visibility("read")
338
+ @doc("The type of identity that created the resource.")
339
+ createdAt?: plainDate;
340
+
341
+ @visibility("read")
342
+ @doc("The identity that last modified the resource.")
343
+ lastModifiedBy?: string;
344
+
345
+ @visibility("read")
346
+ @doc("The type of identity that last modified the resource.")
347
+ lastModifiedByType?: createdByType;
348
+
349
+ @visibility("read")
350
+ @doc("The timestamp of resource last modification (UTC)")
351
+ lastModifiedAt?: plainDate;
352
+ }
353
+
354
+ /**
355
+ * The kind of entity that created the resource.
356
+ */
357
+ // NOTE: This is how the extensible enum is named in types.json
358
+ @doc("The kind of entity that created the resource.")
359
+ union createdByType {
360
+ @doc("The entity was created by a user.")
361
+ User: "User",
362
+
363
+ @doc("The entity was created by an application.")
364
+ Application: "Application",
365
+
366
+ @doc("The entity was created by a managed identity.")
367
+ ManagedIdentity: "ManagedIdentity",
368
+
369
+ @doc("The entity was created by a key.")
370
+ Key: "Key",
371
+
372
+ string,
373
+ }
374
+
375
+ /**
376
+ * Details of the resource plan.
377
+ */
378
+ @doc("Details of the resource plan.")
379
+ @armCommonDefinition("Plan", Azure.ResourceManager.CommonTypes.Versions.v3)
380
+ @armCommonDefinition("Plan", Azure.ResourceManager.CommonTypes.Versions.v4)
381
+ @armCommonDefinition("Plan", Azure.ResourceManager.CommonTypes.Versions.v5)
382
+ model ResourcePlanType {
383
+ @doc("A user defined name of the 3rd Party Artifact that is being procured.")
384
+ name: string;
385
+
386
+ @doc("The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic")
387
+ publisher: string;
388
+
389
+ @doc("The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. ")
390
+ product: string;
391
+
392
+ @doc("A publisher provided promotion code as provisioned in Data Market for the said product/artifact.")
393
+ promotionCode?: string;
394
+
395
+ @doc("The version of the desired product/artifact.")
396
+ version?: string;
397
+ }
398
+
399
+ /**
400
+ * The check availability request body.
401
+ */
402
+ @armCommonDefinition("CheckNameAvailabilityRequest", Azure.ResourceManager.CommonTypes.Versions.v3)
403
+ @armCommonDefinition("CheckNameAvailabilityRequest", Azure.ResourceManager.CommonTypes.Versions.v4)
404
+ @armCommonDefinition("CheckNameAvailabilityRequest", Azure.ResourceManager.CommonTypes.Versions.v5)
405
+ @doc("The check availability request body.")
406
+ model CheckNameAvailabilityRequest {
407
+ @doc("The name of the resource for which availability needs to be checked.")
408
+ name?: string;
409
+
410
+ @doc("The resource type.")
411
+ type?: string;
412
+ }
413
+
414
+ /**
415
+ * The check availability result.
416
+ */
417
+ @armCommonDefinition("CheckNameAvailabilityResponse", Azure.ResourceManager.CommonTypes.Versions.v3)
418
+ @armCommonDefinition("CheckNameAvailabilityResponse", Azure.ResourceManager.CommonTypes.Versions.v4)
419
+ @armCommonDefinition("CheckNameAvailabilityResponse", Azure.ResourceManager.CommonTypes.Versions.v5)
420
+ @doc("The check availability result.")
421
+ model CheckNameAvailabilityResponse {
422
+ @doc("Indicates if the resource name is available.")
423
+ nameAvailable?: boolean;
424
+
425
+ @doc("The reason why the given name is not available.")
426
+ reason?: CheckNameAvailabilityReason;
427
+
428
+ @doc("Detailed reason why the given name is not available.")
429
+ message?: string;
430
+ }
431
+
432
+ /**
433
+ * Possible reasons for a name not being available.
434
+ */
435
+ @doc("Possible reasons for a name not being available.")
436
+ union CheckNameAvailabilityReason {
437
+ @doc("Name is invalid.")
438
+ Invalid: "Invalid",
439
+
440
+ @doc("Name already exists.")
441
+ AlreadyExists: "AlreadyExists",
442
+
443
+ string,
444
+ }
package/lib/models.tsp CHANGED
@@ -7,6 +7,28 @@ using Azure.ResourceManager.Private;
7
7
 
8
8
  namespace Azure.ResourceManager;
9
9
 
10
+ /**
11
+ * Spread this model into ARM resource models to specify resource name parameter for its operations. If `Resource` parameter
12
+ * is specified, the resource name will be properly camel cased and pluralized for `@key` and `@segment`
13
+ * automatically. You can also apply explicit override with `KeyName` and `SegmentName` template parameters.
14
+ * @template Resource The ARM resource this name parameter is applying to.
15
+ * @template KeyName Override default key name of the resource.
16
+ * @template SegmentName Override default segment name of the resource.
17
+ * @template NamePattern The RegEx pattern of the name. Default is `^[a-zA-Z0-9-]{3,24}$`.
18
+ */
19
+ model ResourceNameParameter<
20
+ Resource extends ArmResource,
21
+ KeyName extends valueof string = "",
22
+ SegmentName extends valueof string = "",
23
+ NamePattern extends valueof string = "^[a-zA-Z0-9-]{3,24}$"
24
+ > {
25
+ @doc("The name of the {name}", Resource)
26
+ @pattern(NamePattern)
27
+ @defaultResourceKeySegmentName(Resource, KeyName, SegmentName)
28
+ @path
29
+ name: string;
30
+ }
31
+
10
32
  //#region Standard Resource Operation Interfaces
11
33
  /**
12
34
  * Concrete tracked resource types can be created by aliasing this type using a specific property type.
@@ -149,6 +171,20 @@ model DefaultProvisioningStateProperty {
149
171
  provisioningState?: ResourceProvisioningState;
150
172
  }
151
173
 
174
+ /** The standard evenlop definition of ExtendedLocation.
175
+ *
176
+ * @example
177
+ * ```typespec
178
+ * model Employee is TrackedResource<EmployeeProperties> {
179
+ * ...ResourceNameParameter<Employee>;
180
+ * ...ExtendedLocationProperty;
181
+ * }
182
+ * ```
183
+ */
184
+ model ExtendedLocationProperty {
185
+ extendedLocation: Foundations.ExtendedLocation;
186
+ }
187
+
152
188
  /**
153
189
  * Standard Azure Resource Manager definition of ManagedServiceIdentity
154
190
  */
@@ -82,3 +82,14 @@ extern dec resourceParameterBaseFor(target: ModelProperty, values: unknown[]);
82
82
  * Marks an enum as representing the valid `common-types` versions.
83
83
  */
84
84
  extern dec armCommonTypesVersions(target: Enum);
85
+
86
+ /**
87
+ * Provides default name decoration on resource name property with
88
+ * camelcased and pluralized key and segment name
89
+ */
90
+ extern dec defaultResourceKeySegmentName(
91
+ target: ModelProperty,
92
+ armResource: Model,
93
+ keyName: valueof string,
94
+ segment: valueof string
95
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/typespec-azure-resource-manager",
3
- "version": "0.42.0-dev.10",
3
+ "version": "0.42.0-dev.12",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec Azure Resource Manager library",
6
6
  "homepage": "https://azure.github.io/typespec-azure",
@@ -34,10 +34,14 @@
34
34
  "node": ">=18.0.0"
35
35
  },
36
36
  "files": [
37
- "lib/*.tsp",
37
+ "lib/**/*.tsp",
38
38
  "dist/**",
39
39
  "!dist/test/**"
40
40
  ],
41
+ "dependencies": {
42
+ "change-case": "~5.4.4",
43
+ "pluralize": "^8.0.0"
44
+ },
41
45
  "peerDependencies": {
42
46
  "@azure-tools/typespec-autorest": "~0.41.1 || >=0.42.0-dev <0.42.0",
43
47
  "@azure-tools/typespec-azure-core": "~0.41.0 || >=0.42.0-dev <0.42.0",
@@ -51,6 +55,7 @@
51
55
  "@azure-tools/typespec-autorest": "~0.41.1 || >=0.42.0-dev <0.42.0",
52
56
  "@azure-tools/typespec-azure-core": "~0.41.0 || >=0.42.0-dev <0.42.0",
53
57
  "@types/node": "~18.11.19",
58
+ "@types/pluralize": "^0.0.33",
54
59
  "@typespec/compiler": "~0.55.0 || >=0.56.0-dev <0.56.0",
55
60
  "@typespec/http": "~0.55.0 || >=0.56.0-dev <0.56.0",
56
61
  "@typespec/library-linter": "~0.55.0 || >=0.56.0-dev <0.56.0",
@@ -65,7 +70,6 @@
65
70
  "vitest": "^1.5.0",
66
71
  "@typespec/tspd": "~0.46.0"
67
72
  },
68
- "dependencies": {},
69
73
  "scripts": {
70
74
  "clean": "rimraf ./dist ./temp",
71
75
  "build": "tsc -p . && npm run lint-typespec-library",