@azure-tools/typespec-azure-resource-manager 0.43.0-dev.9 → 0.44.0-dev.0
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 +3 -3
- package/dist/src/common-types.d.ts +3 -2
- package/dist/src/common-types.d.ts.map +1 -1
- package/dist/src/common-types.js +48 -6
- 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/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 -42
- package/dist/src/private.decorators.d.ts.map +1 -1
- package/dist/src/private.decorators.js +0 -74
- 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/core-operations.js +1 -1
- package/dist/src/rules/core-operations.js.map +1 -1
- package/lib/Legacy/arm.legacy.tsp +1 -0
- package/lib/Legacy/managed-identity.tsp +74 -0
- package/lib/arm.tsp +3 -7
- 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 -87
- package/lib/common-types/private-links-ref.tsp +159 -0
- package/lib/common-types/private-links.tsp +55 -101
- package/lib/common-types/types-ref.tsp +414 -0
- package/lib/common-types/types.tsp +323 -201
- 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/models.tsp +18 -3
- package/lib/parameters.tsp +14 -67
- package/lib/private.decorators.tsp +0 -38
- package/lib/responses.tsp +1 -13
- package/package.json +14 -14
|
@@ -7,7 +7,6 @@ import { getArmProviderNamespace, isArmLibraryNamespace } from "./namespace.js";
|
|
|
7
7
|
import { getArmResourceKind, getResourceBaseType, isArmVirtualResource, resolveResourceBaseType, } from "./resource.js";
|
|
8
8
|
import { ArmStateKeys } from "./state.js";
|
|
9
9
|
export const namespace = "Azure.ResourceManager.Private";
|
|
10
|
-
export const ArmCommonTypesDefaultVersion = "v3";
|
|
11
10
|
export function $omitIfEmpty(context, entity, propertyName) {
|
|
12
11
|
const modelProp = getProperty(entity, propertyName);
|
|
13
12
|
if (modelProp &&
|
|
@@ -89,73 +88,6 @@ function isResourceParameterBaseForInternal(program, property, resolvedBaseType)
|
|
|
89
88
|
}
|
|
90
89
|
return false;
|
|
91
90
|
}
|
|
92
|
-
function getArmTypesPath(program) {
|
|
93
|
-
return program.getOption("arm-types-path") || "{arm-types-dir}";
|
|
94
|
-
}
|
|
95
|
-
function storeCommonTypeRecord(context, entity, kind, name, version, referenceFile) {
|
|
96
|
-
const basePath = getArmTypesPath(context.program).trim();
|
|
97
|
-
// NOTE: Right now we don't try to prevent multiple versions from declaring that they are the default
|
|
98
|
-
let isDefault = false;
|
|
99
|
-
if (version && typeof version !== "string" && !("valueKind" in version)) {
|
|
100
|
-
isDefault = !!version.isDefault;
|
|
101
|
-
version = version.version;
|
|
102
|
-
}
|
|
103
|
-
// for backward compatibility, skip if we are trying to access a non-default file and emit the type
|
|
104
|
-
if ((version || referenceFile) && basePath.endsWith(".json"))
|
|
105
|
-
return;
|
|
106
|
-
if (!version)
|
|
107
|
-
version = ArmCommonTypesDefaultVersion;
|
|
108
|
-
if (!referenceFile)
|
|
109
|
-
referenceFile = "types.json";
|
|
110
|
-
const versionStr = typeof version === "string" ? version : version.value.name;
|
|
111
|
-
const records = getCommonTypeRecords(context.program, entity);
|
|
112
|
-
records.records[versionStr] = {
|
|
113
|
-
name,
|
|
114
|
-
kind,
|
|
115
|
-
version: versionStr,
|
|
116
|
-
basePath,
|
|
117
|
-
referenceFile,
|
|
118
|
-
};
|
|
119
|
-
if (isDefault) {
|
|
120
|
-
records.defaultKey = versionStr;
|
|
121
|
-
}
|
|
122
|
-
context.program.stateMap(ArmStateKeys.armCommonDefinitions).set(entity, records);
|
|
123
|
-
}
|
|
124
|
-
export function getCommonTypeRecords(program, entity) {
|
|
125
|
-
return program.stateMap(ArmStateKeys.armCommonDefinitions).get(entity) ?? { records: {} };
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Refer an model property to be a common ARM parameter
|
|
129
|
-
* @param {DecoratorContext} context DecoratorContext object
|
|
130
|
-
* @param {Type} entity Decorator target type. Must be `Model`
|
|
131
|
-
* @param {string?} definitionName Optional definition name
|
|
132
|
-
* @param {string?} version Optional version
|
|
133
|
-
* @param {string?} referenceFile Optional common file path
|
|
134
|
-
* @returns void
|
|
135
|
-
*/
|
|
136
|
-
export function $armCommonParameter(context, entity, parameterName, version, referenceFile) {
|
|
137
|
-
// Use the name of the model type if not specified
|
|
138
|
-
if (!parameterName) {
|
|
139
|
-
parameterName = entity.name;
|
|
140
|
-
}
|
|
141
|
-
storeCommonTypeRecord(context, entity, "parameters", parameterName, version, referenceFile);
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Using ARM common definition for a Model
|
|
145
|
-
* @param {DecoratorContext} context DecoratorContext object
|
|
146
|
-
* @param {Type} entity Decorator target type. Must be `Model`
|
|
147
|
-
* @param {string?} definitionName Optional definition name
|
|
148
|
-
* @param {string?} version Optional version
|
|
149
|
-
* @param {string?} referenceFile Optional common file path
|
|
150
|
-
* @returns {void}
|
|
151
|
-
*/
|
|
152
|
-
export function $armCommonDefinition(context, entity, definitionName, version, referenceFile) {
|
|
153
|
-
// Use the name of the model type if not specified
|
|
154
|
-
if (!definitionName) {
|
|
155
|
-
definitionName = entity.name;
|
|
156
|
-
}
|
|
157
|
-
storeCommonTypeRecord(context, entity, "definitions", definitionName, version, referenceFile);
|
|
158
|
-
}
|
|
159
91
|
/**
|
|
160
92
|
* This decorator dynamically assigns the serviceNamespace from the containing
|
|
161
93
|
* namespace to the string literal value of the path parameter to which this
|
|
@@ -320,10 +252,4 @@ function hasProperty(program, model) {
|
|
|
320
252
|
return hasProperty(program, model.baseModel);
|
|
321
253
|
return false;
|
|
322
254
|
}
|
|
323
|
-
export function $armCommonTypesVersions(context, enumType) {
|
|
324
|
-
context.program.stateMap(ArmStateKeys.armCommonTypesVersions).set(enumType, {
|
|
325
|
-
type: enumType,
|
|
326
|
-
allVersions: Array.from(enumType.members.values()).reverse(),
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
255
|
//# sourceMappingURL=private.decorators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private.decorators.js","sourceRoot":"","sources":["../../src/private.decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,WAAW,
|
|
1
|
+
{"version":3,"file":"private.decorators.js","sourceRoot":"","sources":["../../src/private.decorators.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EACJ,WAAW,EASX,UAAU,EACV,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,E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/rules/arm-common-types-version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"arm-common-types-version.d.ts","sourceRoot":"","sources":["../../../src/rules/arm-common-types-version.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;EA6CpC,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createRule } from "@typespec/compiler";
|
|
2
2
|
import { getAllHttpServices } from "@typespec/http";
|
|
3
3
|
import { getVersion } from "@typespec/versioning";
|
|
4
|
-
import { getArmCommonTypesVersion } from "../common-types.js";
|
|
5
4
|
import { getArmProviderNamespace } from "../namespace.js";
|
|
6
5
|
/**
|
|
7
6
|
* The @armCommonTypesVersion decorator should be used to set the ARM
|
|
@@ -29,8 +28,8 @@ export const armCommonTypesVersionRule = createRule({
|
|
|
29
28
|
if (!(versionMap &&
|
|
30
29
|
versionMap
|
|
31
30
|
.getVersions()
|
|
32
|
-
.every((version) => !!
|
|
33
|
-
!
|
|
31
|
+
.every((version) => !!version.enumMember.decorators.find((x) => x.definition?.name === "@armCommonTypesVersion"))) &&
|
|
32
|
+
!service.namespace.decorators.find((x) => x.definition?.name === "@armCommonTypesVersion")) {
|
|
34
33
|
context.reportDiagnostic({
|
|
35
34
|
target: service.namespace,
|
|
36
35
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arm-common-types-version.js","sourceRoot":"","sources":["../../../src/rules/arm-common-types-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"arm-common-types-version.js","sourceRoot":"","sources":["../../../src/rules/arm-common-types-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiC,UAAU,EAAE,MAAM,oBAAo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AC,gBAAgB,CAAC;4BACvB,MAAM,EAAE,OAAO,CAAC,SAAS;yBAC1B,CAAC,CAAC;oBACL,CAAC;gBACH,CAAC;YACH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -68,7 +68,7 @@ function isApiParameter(program, property) {
|
|
|
68
68
|
if (sourceModel === undefined)
|
|
69
69
|
return false;
|
|
70
70
|
return (sourceModel.name === "ApiVersionParameter" &&
|
|
71
|
-
getNamespaceName(program, sourceModel) === "Azure.ResourceManager");
|
|
71
|
+
getNamespaceName(program, sourceModel) === "Azure.ResourceManager.CommonTypes");
|
|
72
72
|
}
|
|
73
73
|
function hasApiParameter(program, model) {
|
|
74
74
|
if (model.properties === undefined || model.properties.size === 0)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-operations.js","sourceRoot":"","sources":["../../../src/rules/core-operations.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,UAAU,EACV,UAAU,EACV,YAAY,GACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAY,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,6BAA6B,GAC9B,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;IAC3C,IAAI,EAAE,wBAAwB;IAC9B,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,mCAAmC;IAChD,QAAQ,EAAE;QACR,OAAO,EACL,+PAA+P;QACjQ,kBAAkB,EAAE,yDAAyD;QAC7E,kBAAkB,EAAE,YAAY,CAAA,YAAY,MAAM,qCAAqC,WAAW,GAAG;KACtG;IACD,MAAM,CAAC,OAAO;QACZ,OAAO;YACL,SAAS,EAAE,CAAC,SAAoB,EAAE,EAAE;gBAClC,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC;oBACpD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AK,CAAC;IAC5C,OAAO,CACL,WAAW,CAAC,IAAI,KAAK,qBAAqB;QAC1C,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,mCAAmC,CAC/E,CAAC;AACJ,CAAC;AAED,SAAS,eAAe,CAAC,OAAgB,EAAE,KAAY;IACrD,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAChF,MAAM,gBAAgB,GAAoB,CAAC,GAAG,KAAK,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CACpF,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAC3B,CAAC;IACF,OAAO,gBAAgB,KAAK,IAAI,IAAI,gBAAgB,CAAC,MAAM,KAAK,CAAC,CAAC;AACpE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./managed-identity.tsp";
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "@azure-tools/typespec-azure-core";
|
|
2
|
+
import "../common-types/common-types.tsp";
|
|
3
|
+
|
|
4
|
+
using Azure.Core;
|
|
5
|
+
using Azure.ResourceManager.CommonTypes.Private;
|
|
6
|
+
|
|
7
|
+
namespace Azure.ResourceManager.Legacy;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Model representing the standard `ManagedServiceIdentity` envelope property from V4 of common type.
|
|
11
|
+
*
|
|
12
|
+
* Please note that this is only included for legacy specs with mixed v3 and v4 types, which would cause
|
|
13
|
+
* breaking changes due to the ManagedServiceIdentityType.SystemAndUserAssigned value changes.
|
|
14
|
+
*
|
|
15
|
+
* Do not use this if you are already on CommonTypes.Version.v4 or beyond.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* ```typespec
|
|
20
|
+
* model Foo is TrackedResource<FooProperties> {
|
|
21
|
+
* ...ResourceNameParameter<Foo>;
|
|
22
|
+
* ...Legacy.ManagedServiceIdentityV4Property;
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
@doc("The managed service identities envelope.")
|
|
27
|
+
model ManagedServiceIdentityV4Property {
|
|
28
|
+
@doc("The managed service identities assigned to this resource.")
|
|
29
|
+
identity?: ManagedServiceIdentityV4;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Managed service identity (system assigned and/or user assigned identities)
|
|
34
|
+
*/
|
|
35
|
+
#suppress "@azure-tools/typespec-azure-resource-manager/arm-common-types-incompatible-version" "intended only for v3/v4 mix backcompat cases"
|
|
36
|
+
@armCommonDefinition(
|
|
37
|
+
"ManagedServiceIdentity",
|
|
38
|
+
#{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true },
|
|
39
|
+
"managedidentity.json"
|
|
40
|
+
)
|
|
41
|
+
model ManagedServiceIdentityV4 {
|
|
42
|
+
/** The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. */
|
|
43
|
+
@visibility("read")
|
|
44
|
+
principalId?: uuid;
|
|
45
|
+
|
|
46
|
+
/** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */
|
|
47
|
+
@visibility("read")
|
|
48
|
+
tenantId?: uuid;
|
|
49
|
+
|
|
50
|
+
/** The type of managed identity assigned to this resource. */
|
|
51
|
+
type: ManagedServiceIdentityType;
|
|
52
|
+
|
|
53
|
+
/** The identities assigned to this resource by the user. */
|
|
54
|
+
userAssignedIdentities?: Record<Azure.ResourceManager.CommonTypes.UserAssignedIdentity>;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed).
|
|
59
|
+
*/
|
|
60
|
+
union ManagedServiceIdentityType {
|
|
61
|
+
/** No managed identity. */
|
|
62
|
+
None: "None",
|
|
63
|
+
|
|
64
|
+
/** System assigned managed identity. */
|
|
65
|
+
SystemAssigned: "SystemAssigned",
|
|
66
|
+
|
|
67
|
+
/** User assigned managed identity. */
|
|
68
|
+
UserAssigned: "UserAssigned",
|
|
69
|
+
|
|
70
|
+
/** System and user assigned managed identity. */
|
|
71
|
+
SystemAndUserAssigned: "SystemAssigned, UserAssigned",
|
|
72
|
+
|
|
73
|
+
string,
|
|
74
|
+
}
|
package/lib/arm.tsp
CHANGED
|
@@ -5,14 +5,10 @@ import "@typespec/rest";
|
|
|
5
5
|
import "@typespec/versioning";
|
|
6
6
|
import "@azure-tools/typespec-azure-core";
|
|
7
7
|
|
|
8
|
-
import "./arm.foundations.tsp";
|
|
8
|
+
import "./foundations/arm.foundations.tsp";
|
|
9
|
+
import "./Legacy/arm.legacy.tsp";
|
|
9
10
|
import "./common-types/common-types.tsp";
|
|
10
|
-
import "./
|
|
11
|
-
import "./common-types/types.tsp";
|
|
12
|
-
import "./common-types/managed-identity.tsp";
|
|
13
|
-
import "./common-types/private-links.tsp";
|
|
14
|
-
import "./common-types/customer-managed-keys.tsp";
|
|
15
|
-
import "./common-types/extended-location.tsp";
|
|
11
|
+
import "./backcompat.tsp";
|
|
16
12
|
import "./private.decorators.tsp";
|
|
17
13
|
import "./models.tsp";
|
|
18
14
|
import "./operations.tsp";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
using Azure.ResourceManager.CommonTypes;
|
|
2
|
+
|
|
3
|
+
namespace Azure.ResourceManager;
|
|
4
|
+
|
|
5
|
+
// customer-managed-keys
|
|
6
|
+
alias InfrastructureEncryption = CommonTypes.InfrastructureEncryption;
|
|
7
|
+
alias KeyEncryptionIdentity = CommonTypes.KeyEncryptionKeyIdentity;
|
|
8
|
+
alias KeyEncryptionKeyIdentity = CommonTypes.KeyEncryptionKeyIdentity;
|
|
9
|
+
alias CustomerManagedKeyEncryption = CommonTypes.CustomerManagedKeyEncryption;
|
|
10
|
+
alias EncryptionConfiguration = CommonTypes.Encryption;
|
|
11
|
+
|
|
12
|
+
// private-links
|
|
13
|
+
alias PrivateEndpoint = CommonTypes.PrivateEndpoint;
|
|
14
|
+
alias PrivateEndpointConnection = CommonTypes.PrivateEndpointConnection;
|
|
15
|
+
alias PrivateEndpointConnectionProperties = CommonTypes.PrivateEndpointConnectionProperties;
|
|
16
|
+
alias PrivateLinkServiceConnectionState = CommonTypes.PrivateLinkServiceConnectionState;
|
|
17
|
+
alias PrivateEndpointConnectionProvisioningState = CommonTypes.PrivateEndpointConnectionProvisioningState;
|
|
18
|
+
alias PrivateEndpointServiceConnectionStatus = CommonTypes.PrivateEndpointServiceConnectionStatus;
|
|
19
|
+
alias PrivateEndpointConnectionParameter = CommonTypes.PrivateEndpointConnectionParameter;
|
|
20
|
+
alias PrivateLinkResource = CommonTypes.PrivateLinkResource;
|
|
21
|
+
alias PrivateLinkResourceProperties = CommonTypes.PrivateLinkResourceProperties;
|
|
22
|
+
alias PrivateLinkResourceParameter = CommonTypes.PrivateLinkResourceParameter;
|
|
23
|
+
alias PrivateEndpointConnectionResourceListResult = CommonTypes.PrivateEndpointConnectionListResult;
|
|
24
|
+
alias PrivateLinkResourceListResult = CommonTypes.PrivateLinkResourceListResult;
|
|
25
|
+
|
|
26
|
+
// types
|
|
27
|
+
alias ErrorResponse = CommonTypes.ErrorResponse;
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import "@typespec/versioning";
|
|
2
|
+
import "@azure-tools/typespec-azure-core";
|
|
3
|
+
import "./common-types.tsp";
|
|
4
|
+
import "./types-ref.tsp";
|
|
5
|
+
import "./managed-identity-ref.tsp";
|
|
6
|
+
import "./private-links-ref.tsp";
|
|
7
|
+
import "./customer-managed-keys-ref.tsp";
|
|
8
|
+
import "./extended-location-ref.tsp";
|
|
9
|
+
import "./internal.tsp";
|
|
10
|
+
import "./commontypes.private.decorators.tsp";
|
|
2
11
|
|
|
3
12
|
using TypeSpec.Versioning;
|
|
4
13
|
|
|
14
|
+
@versioned(Versions)
|
|
5
15
|
namespace Azure.ResourceManager.CommonTypes;
|
|
6
16
|
|
|
7
|
-
@Private.armCommonTypesVersions
|
|
17
|
+
@CommonTypes.Private.armCommonTypesVersions
|
|
8
18
|
@doc("The Azure Resource Manager common-types versions.")
|
|
9
19
|
enum Versions {
|
|
10
20
|
@doc("The Azure Resource Manager v3 common types.")
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import "../../dist/src/commontypes.private.decorators.js";
|
|
2
|
+
|
|
3
|
+
namespace Azure.ResourceManager.CommonTypes.Private;
|
|
4
|
+
|
|
5
|
+
using TypeSpec.Reflection;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Describes the shape of model literals accepted by the `version` parameter of
|
|
9
|
+
* the `armCommonDefinition` and `armCommonParameter` decorators.
|
|
10
|
+
*/
|
|
11
|
+
alias ArmCommonTypeVersionSpec = {
|
|
12
|
+
version: string | EnumMember;
|
|
13
|
+
isDefault: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @param definitionName Definition name
|
|
18
|
+
* @param version Azure Resource Manager Version
|
|
19
|
+
* @param referenceFile Reference file
|
|
20
|
+
*/
|
|
21
|
+
extern dec armCommonDefinition(
|
|
22
|
+
target: Model,
|
|
23
|
+
definitionName?: valueof string,
|
|
24
|
+
version?: valueof EnumMember | ArmCommonTypeVersionSpec | string,
|
|
25
|
+
referenceFile?: valueof string
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param definitionName Definition name
|
|
30
|
+
* @param version Azure Resource Manager Version
|
|
31
|
+
* @param referenceFile Reference file
|
|
32
|
+
*/
|
|
33
|
+
extern dec armCommonParameter(
|
|
34
|
+
target: ModelProperty,
|
|
35
|
+
definitionName?: valueof string,
|
|
36
|
+
version?: valueof EnumMember | ArmCommonTypeVersionSpec | string,
|
|
37
|
+
referenceFile?: valueof string
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Marks an enum as representing the valid `common-types` versions.
|
|
42
|
+
*/
|
|
43
|
+
extern dec armCommonTypesVersions(target: Enum);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import "./customer-managed-keys.tsp";
|
|
2
|
+
|
|
3
|
+
using Azure.ResourceManager.CommonTypes.Private;
|
|
4
|
+
|
|
5
|
+
namespace Azure.ResourceManager.CommonTypes;
|
|
6
|
+
|
|
7
|
+
@@armCommonDefinition(Encryption,
|
|
8
|
+
"encryption",
|
|
9
|
+
#{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true },
|
|
10
|
+
"customermanagedkeys.json"
|
|
11
|
+
);
|
|
12
|
+
@@armCommonDefinition(Encryption,
|
|
13
|
+
"encryption",
|
|
14
|
+
Azure.ResourceManager.CommonTypes.Versions.v5,
|
|
15
|
+
"customermanagedkeys.json"
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
@@armCommonDefinition(CustomerManagedKeyEncryption,
|
|
19
|
+
"customerManagedKeyEncryption",
|
|
20
|
+
#{ version: Azure.ResourceManager.CommonTypes.Versions.v4, isDefault: true },
|
|
21
|
+
"customermanagedkeys.json"
|
|
22
|
+
);
|
|
23
|
+
@@armCommonDefinition(CustomerManagedKeyEncryption,
|
|
24
|
+
"customerManagedKeyEncryption",
|
|
25
|
+
Azure.ResourceManager.CommonTypes.Versions.v5,
|
|
26
|
+
"customermanagedkeys.json"
|
|
27
|
+
);
|
|
@@ -1,84 +1,75 @@
|
|
|
1
1
|
using Azure.Core;
|
|
2
|
-
using
|
|
2
|
+
using TypeSpec.Versioning;
|
|
3
3
|
|
|
4
|
-
namespace Azure.ResourceManager;
|
|
4
|
+
namespace Azure.ResourceManager.CommonTypes;
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
/** (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
|
+
@added(Versions.v4)
|
|
7
8
|
union InfrastructureEncryption {
|
|
8
|
-
|
|
9
|
+
/** Encryption is enabled */
|
|
9
10
|
Enabled: "enabled",
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
/** Encryption is disabled */
|
|
12
13
|
Disabled: "disabled",
|
|
13
14
|
|
|
14
15
|
string,
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
union KeyEncryptionKeyIdentity {
|
|
22
|
-
@doc("System assigned identity")
|
|
18
|
+
/** The type of identity to use. */
|
|
19
|
+
@added(Versions.v4)
|
|
20
|
+
union KeyEncryptionKeyIdentityType {
|
|
21
|
+
/** System assigned identity */
|
|
23
22
|
SystemAssignedIdentity: "systemAssignedIdentity",
|
|
24
23
|
|
|
25
|
-
|
|
24
|
+
/** User assigned identity */
|
|
26
25
|
UserAssignedIdentity: "userAssignedIdentity",
|
|
27
26
|
|
|
28
|
-
|
|
27
|
+
/** Delegated identity */
|
|
29
28
|
DelegatedResourceIdentity: "delegatedResourceIdentity",
|
|
30
29
|
|
|
31
30
|
string,
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
/** All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. */
|
|
34
|
+
@added(Versions.v4)
|
|
35
|
+
model KeyEncryptionKeyIdentity {
|
|
36
|
+
/** The type of identity to use. Values can be systemAssignedIdentity, userAssignedIdentity, or delegatedResourceIdentity. */
|
|
37
|
+
identityType?: KeyEncryptionKeyIdentityType;
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
/** 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. */
|
|
40
40
|
userAssignedIdentityResourceId?: Azure.Core.armResourceIdentifier<[
|
|
41
41
|
{
|
|
42
42
|
type: "Microsoft.ManagedIdentity/userAssignedIdentities";
|
|
43
43
|
}
|
|
44
44
|
]>;
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
/** application client identity to use for accessing key encryption key Url in a different tenant. Ex: f83c6b1b-4d34-47e4-bb34-9d83df58b540 */
|
|
47
|
+
@added(Versions.v5)
|
|
47
48
|
federatedClientId?: uuid;
|
|
48
49
|
|
|
49
|
-
|
|
50
|
+
/** delegated 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 and userAssignedIdentity - internal use only. */
|
|
50
51
|
delegatedIdentityClientId?: uuid;
|
|
51
52
|
}
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
@
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
)
|
|
59
|
-
model EncryptionConfiguration {
|
|
60
|
-
@doc("Indicates if infrastructure encryption is enabled or disabled.")
|
|
61
|
-
infrastructureEncryption?: InfrastructureEncryption;
|
|
62
|
-
|
|
63
|
-
@doc("All customer-managed key encryption properties for the resource.")
|
|
64
|
-
customerManagedKeyEncryption?: CustomerManagedKeyEncryption;
|
|
54
|
+
/** Customer-managed key encryption properties for the resource. */
|
|
55
|
+
@added(Versions.v4)
|
|
56
|
+
model CustomerManagedKeyEncryption {
|
|
57
|
+
/** All identity configuration for Customer-managed key settings defining which identity should be used to auth to Key Vault. */
|
|
58
|
+
keyEncryptionKeyIdentity?: KeyEncryptionKeyIdentity;
|
|
65
59
|
|
|
66
|
-
|
|
60
|
+
/** key encryption key Url, versioned or non-versioned. Ex: https://contosovault.vault.azure.net/keys/contosokek/562a4bb76b524a1493a6afe8e536ee78 or https://contosovault.vault.azure.net/keys/contosokek. */
|
|
67
61
|
keyEncryptionKeyUrl?: string;
|
|
68
62
|
}
|
|
69
63
|
|
|
70
|
-
/**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
*
|
|
74
|
-
* ```typespec
|
|
75
|
-
* model Foo is TrackedResource<FooProperties> {
|
|
76
|
-
* ...Encryption;
|
|
77
|
-
* }
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
@doc("All encryption configuration for a resource.")
|
|
64
|
+
/** (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. */
|
|
65
|
+
@added(Versions.v4)
|
|
66
|
+
@encodedName("application/json", "encryption")
|
|
81
67
|
model Encryption {
|
|
82
|
-
|
|
83
|
-
|
|
68
|
+
/** Values are enabled and disabled. */
|
|
69
|
+
infrastructureEncryption?: InfrastructureEncryption;
|
|
70
|
+
|
|
71
|
+
/** All Customer-managed key encryption properties for the resource. */
|
|
72
|
+
@added(Versions.v4)
|
|
73
|
+
@removed(Versions.v5)
|
|
74
|
+
customerManagedKeyEncryption?: CustomerManagedKeyEncryption;
|
|
84
75
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./extended-location.tsp";
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
namespace Azure.ResourceManager.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
namespace Azure.ResourceManager.CommonTypes;
|
|
2
|
+
/** The complex type of the extended location. */
|
|
3
|
+
model ExtendedLocation {
|
|
4
|
+
/** The name of the extended location. */
|
|
5
|
+
name: string;
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
/** The type of the extended location. */
|
|
8
|
+
type: ExtendedLocationType;
|
|
9
|
+
}
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
/** The supported ExtendedLocation types. */
|
|
12
|
+
union ExtendedLocationType {
|
|
13
|
+
/** Azure Edge Zones location type */
|
|
14
|
+
EdgeZone: "EdgeZone",
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
/** Azure Custom Locations type */
|
|
17
|
+
CustomLocation: "CustomLocation",
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
}
|
|
19
|
+
string,
|
|
21
20
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
namespace Azure.ResourceManager.CommonTypes;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* An internal enum to indicate the resource support for various path types
|
|
5
|
+
*/
|
|
6
|
+
enum ResourceHome {
|
|
7
|
+
@doc("The resource is bound to a tenant")
|
|
8
|
+
Tenant,
|
|
9
|
+
|
|
10
|
+
@doc("The resource is bound to a subscription")
|
|
11
|
+
Subscription,
|
|
12
|
+
|
|
13
|
+
@doc("The resource is bound to a location")
|
|
14
|
+
Location,
|
|
15
|
+
|
|
16
|
+
@doc("The resource is bound to a resource group")
|
|
17
|
+
ResourceGroup,
|
|
18
|
+
|
|
19
|
+
@doc("The resource is bound to an extension")
|
|
20
|
+
Extension,
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Alias of keyEncryptionKeyIdentity for back compatibility. Please change to keyEncryptionKeyIdentity. */
|
|
24
|
+
alias KeyEncryptionIdentity = KeyEncryptionKeyIdentity;
|