@azure-tools/typespec-azure-resource-manager 0.42.0-dev.5 → 0.42.0-dev.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"arm-resource-patch.d.ts","sourceRoot":"","sources":["../../../src/rules/arm-resource-patch.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,mBAAmB;;;;EAwB9B,CAAC"}
1
+ {"version":3,"file":"arm-resource-patch.d.ts","sourceRoot":"","sources":["../../../src/rules/arm-resource-patch.ts"],"names":[],"mappings":"AAyBA,eAAO,MAAM,mBAAmB;;;;EAwB9B,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { createRule, getEffectiveModelType, getProperty, isErrorType, paramMessage, } from "@typespec/compiler";
2
- import { getOperationVerb, isBody, isHeader, isPathParam, isQueryParam } from "@typespec/http";
2
+ import { getOperationVerb, isBody, isBodyRoot, isHeader, isPathParam, isQueryParam, } from "@typespec/http";
3
3
  import { getArmResource } from "../resource.js";
4
4
  import { getSourceModel, isInternalTypeSpec } from "./utils.js";
5
5
  export const patchOperationsRule = createRule({
@@ -95,7 +95,8 @@ function getPatchModel(program, operation) {
95
95
  isQueryParam(program, property) ||
96
96
  isPathParam(program, property))
97
97
  continue;
98
- if (isBody(program, property) && property.type.kind === "Scalar")
98
+ if ((isBody(program, property) || isBodyRoot(program, property)) &&
99
+ property.type.kind === "Scalar")
99
100
  return undefined;
100
101
  bodyProperties.push(property);
101
102
  }
@@ -1 +1 @@
1
- {"version":3,"file":"arm-resource-patch.js","sourceRoot":"","sources":["../../../src/rules/arm-resource-patch.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,UAAU,EACV,qBAAqB,EACrB,WAAW,EACX,WAAW,EACX,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,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,KAAK,QAAQ;YAE/B,OAAO,SAAS,CAAC;QACnB,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAClD,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,KAAK,OAAO;QACxE,OAAO,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;IACzD,OAAO,cAAc,CAAC;AACxB,CAAC"}
@@ -99,26 +99,30 @@ enum ResourceHome {
99
99
  @doc("""
100
100
  The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
101
101
  """)
102
- enum Origin {
102
+ union Origin {
103
103
  @doc("Indicates the operation is initiated by a user.")
104
- user,
104
+ user: "user",
105
105
 
106
106
  @doc("Indicates the operation is initiated by a system.")
107
- system,
107
+ system: "system",
108
108
 
109
109
  @doc("Indicates the operation is initiated by a user or system.")
110
- `user,system`,
110
+ `user,system`: "user,system",
111
+
112
+ string,
111
113
  }
112
114
 
113
115
  /**
114
- * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
116
+ * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
115
117
  */
116
118
  @doc("""
117
- Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
119
+ Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
118
120
  """)
119
- enum ActionType {
121
+ union ActionType {
120
122
  @doc("Actions are for internal-only APIs.")
121
- Internal,
123
+ Internal: "Internal",
124
+
125
+ string,
122
126
  }
123
127
 
124
128
  /**
@@ -308,20 +312,22 @@ model ArmTagsProperty {
308
312
  /**
309
313
  * The kind of entity that created the resource.
310
314
  */
311
- // NOTE: This is how the enum is named in types.json
315
+ // NOTE: This is how the extensible enum is named in types.json
312
316
  @doc("The kind of entity that created the resource.")
313
- enum createdByType {
317
+ union createdByType {
314
318
  @doc("The entity was created by a user.")
315
- User,
319
+ User: "User",
316
320
 
317
321
  @doc("The entity was created by an application.")
318
- Application,
322
+ Application: "Application",
319
323
 
320
324
  @doc("The entity was created by a managed identity.")
321
- ManagedIdentity,
325
+ ManagedIdentity: "ManagedIdentity",
322
326
 
323
327
  @doc("The entity was created by a key.")
324
- Key,
328
+ Key: "Key",
329
+
330
+ string,
325
331
  }
326
332
 
327
333
  /**
@@ -384,7 +390,7 @@ model ManagedIdentityProperties {
384
390
  principalId?: string;
385
391
 
386
392
  @doc("The type of managed identity assigned to this resource.")
387
- type: ManagedIdentityType;
393
+ type: ManagedServiceIdentityType;
388
394
 
389
395
  @doc("The identities assigned to this resource by the user.")
390
396
  userAssignedIdentities?: Record<UserAssignedIdentity>;
@@ -417,9 +423,12 @@ model ManagedSystemIdentityProperties {
417
423
  principalId?: string;
418
424
 
419
425
  @doc("The type of managed identity assigned to this resource.")
420
- type: ManagedSystemIdentityType;
426
+ type: SystemAssignedServiceIdentityType;
421
427
  }
422
428
 
429
+ /** Alias of ManagedServiceIdentityType for back compatability. Please change to ManagedServiceIdentityType. */
430
+ #deprecated "Please change to ManagedServiceIdentityType."
431
+ alias ManagedIdentityType = ManagedServiceIdentityType;
423
432
  /**
424
433
  * A managed identity assigned by the user.
425
434
  */
@@ -436,30 +445,37 @@ model UserAssignedIdentity {
436
445
  * The kind of managed identity assigned to this resource.
437
446
  */
438
447
  @doc("The kind of managed identity assigned to this resource.")
439
- enum ManagedIdentityType {
448
+ union ManagedServiceIdentityType {
440
449
  @doc("No managed identity.")
441
- None,
450
+ None: "None",
442
451
 
443
452
  @doc("System assigned managed identity.")
444
- SystemAssigned,
453
+ SystemAssigned: "SystemAssigned",
445
454
 
446
455
  @doc("User assigned managed identity.")
447
- UserAssigned,
456
+ UserAssigned: "UserAssigned",
448
457
 
449
458
  @doc("System and user assigned managed identity.")
450
459
  SystemAndUserAssigned: "SystemAssigned, UserAssigned",
460
+
461
+ string,
451
462
  }
452
463
 
464
+ /** Alias of SystemAssignedServiceIdentityType for back compatability. Please change to SystemAssignedServiceIdentityType. */
465
+ alias ManagedSystemIdentityType = SystemAssignedServiceIdentityType;
466
+
453
467
  /**
454
468
  * The kind of managemed identity assigned to this resource.
455
469
  */
456
470
  @doc("The kind of managemed identity assigned to this resource.")
457
- enum ManagedSystemIdentityType {
471
+ union SystemAssignedServiceIdentityType {
458
472
  @doc("No managed system identity.")
459
- None,
473
+ None: "None",
460
474
 
461
475
  @doc("System assigned managed system identity.")
462
- SystemAssigned,
476
+ SystemAssigned: "SystemAssigned",
477
+
478
+ string,
463
479
  }
464
480
 
465
481
  /**
@@ -651,7 +667,7 @@ model Operation {
651
667
  origin?: Origin;
652
668
 
653
669
  @doc("""
654
- Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
670
+ Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs.
655
671
  """)
656
672
  actionType?: ActionType;
657
673
  }
@@ -689,12 +705,14 @@ model CheckNameAvailabilityRequest {
689
705
  * Possible reasons for a name not being available.
690
706
  */
691
707
  @doc("Possible reasons for a name not being available.")
692
- enum CheckNameAvailabilityReason {
708
+ union CheckNameAvailabilityReason {
693
709
  @doc("Name is invalid.")
694
- Invalid,
710
+ Invalid: "Invalid",
695
711
 
696
712
  @doc("Name already exists.")
697
- AlreadyExists,
713
+ AlreadyExists: "AlreadyExists",
714
+
715
+ string,
698
716
  }
699
717
 
700
718
  /**
@@ -776,7 +794,7 @@ op ArmCreateOperation<
776
794
  ErrorResponse extends {}
777
795
  >(
778
796
  ...HttpParameters,
779
- @doc("Resource create parameters.") @body resource: BodyParameter,
797
+ @doc("Resource create parameters.") @bodyRoot resource: BodyParameter,
780
798
  ): Response | ErrorResponse;
781
799
 
782
800
  /**
@@ -793,5 +811,5 @@ op ArmUpdateOperation<
793
811
  ErrorResponse extends {}
794
812
  >(
795
813
  ...HttpParameters,
796
- @doc("The resource properties to be updated.") @body properties: BodyParameter,
814
+ @doc("The resource properties to be updated.") @bodyRoot properties: BodyParameter,
797
815
  ): Response | ErrorResponse;
@@ -4,16 +4,21 @@ using Azure.ResourceManager.Private;
4
4
  namespace Azure.ResourceManager;
5
5
 
6
6
  @doc("(Optional) Discouraged to include in resource definition. Only needed where it is possible to disable platform (AKA infrastructure) encryption. Azure SQL TDE is an example of this. Values are enabled and disabled.")
7
- enum InfrastructureEncryption {
7
+ union InfrastructureEncryption {
8
8
  @doc("Encryption is enabled")
9
9
  Enabled: "enabled",
10
10
 
11
11
  @doc("Encryption is disabled")
12
12
  Disabled: "disabled",
13
+
14
+ string,
13
15
  }
14
16
 
17
+ /** Alias of keyEncryptionKeyIdentity for back compatibility. Please change to keyEncryptionKeyIdentity. */
18
+ alias KeyEncryptionIdentity = KeyEncryptionKeyIdentity;
19
+
15
20
  @doc("The type of identity to use.")
16
- enum KeyEncryptionIdentity {
21
+ union KeyEncryptionKeyIdentity {
17
22
  @doc("System assigned identity")
18
23
  SystemAssignedIdentity: "systemAssignedIdentity",
19
24
 
@@ -22,12 +27,14 @@ enum KeyEncryptionIdentity {
22
27
 
23
28
  @doc("Delegated identity")
24
29
  DelegatedResourceIdentity: "delegatedResourceIdentity",
30
+
31
+ string,
25
32
  }
26
33
 
27
34
  @doc("Customer-managed key encryption properties for the resource.")
28
35
  model CustomerManagedKeyEncryption {
29
36
  @doc("The type of identity to use. Values can be systemAssignedIdentity, userAssignedIdentity, or delegatedResourceIdentity.")
30
- keyEncryptionIdentity?: KeyEncryptionIdentity;
37
+ keyEncryptionKeyIdentity?: KeyEncryptionKeyIdentity;
31
38
 
32
39
  @doc("User assigned identity to use for accessing key encryption key Url. Ex: /subscriptions/fa5fc227-a624-475e-b696-cdd604c735bc/resourceGroups/<resource group>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myId. Mutually exclusive with identityType systemAssignedIdentity.")
33
40
  userAssignedIdentityResourceId?: Azure.Core.armResourceIdentifier<[
package/lib/responses.tsp CHANGED
@@ -13,7 +13,10 @@ namespace Azure.ResourceManager;
13
13
  @doc("Azure operation completed successfully.")
14
14
  model ArmResponse<ResponseBody> {
15
15
  ...OkResponse;
16
- ...Body<ResponseBody>;
16
+
17
+ @doc("The body type of the operation request or response.")
18
+ @bodyRoot
19
+ body: ResponseBody;
17
20
  }
18
21
 
19
22
  /**
@@ -219,7 +222,7 @@ model ArmResourceCreatedResponse<
219
222
 
220
223
  @Azure.Core.pollingLocation(Azure.Core.StatusMonitorPollingOptions<Resource>)
221
224
  @doc("The resource body")
222
- @body
225
+ @bodyRoot
223
226
  body: Resource;
224
227
  }
225
228
 
@@ -228,9 +231,12 @@ model ArmResourceCreatedResponse<
228
231
  * @template Resource The resource being updated
229
232
  */
230
233
  @doc("Resource '{name}' create operation succeeded", Resource)
231
- model ArmResourceCreatedSyncResponse<Resource extends Azure.ResourceManager.Foundations.ArmResource>
232
- is Body<Resource> {
234
+ model ArmResourceCreatedSyncResponse<Resource extends Azure.ResourceManager.Foundations.ArmResource> {
233
235
  ...CreatedResponse;
236
+
237
+ @doc("The body type of the operation request or response.")
238
+ @bodyRoot
239
+ body: Resource;
234
240
  }
235
241
 
236
242
  /**
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.5",
3
+ "version": "0.42.0-dev.7",
4
4
  "author": "Microsoft Corporation",
5
5
  "description": "TypeSpec Azure Resource Manager library",
6
6
  "homepage": "https://azure.github.io/typespec-azure",