Skip to content

Commit

Permalink
Add types for ARM resources
Browse files Browse the repository at this point in the history
  • Loading branch information
tgoodyear committed Mar 8, 2025
1 parent a51cc9d commit 1e335bf
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Microsoft.Mission;
@doc("Request to the action call to check address space availability.")
model CheckAddressSpaceAvailabilityRequest {
@doc("Resource Id of the Community")
communityResourceId: string;
communityResourceId: CommunityResourceId;

@doc("Information about the enclave virtual network")
enclaveVirtualNetwork: EnclaveVirtualNetwork;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@ scalar VirtualEnclaveResourceId
}
]>;

scalar VirtualNetworkResourceId
extends armResourceIdentifier<[
{
type: "Microsoft.Network/virtualNetworks",
}
]>;

scalar SubnetResourceId
extends armResourceIdentifier<[
{
type: "Microsoft.Network/virtualNetworks/subnets",
}
]>;

scalar NsgResourceId
extends armResourceIdentifier<[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ model TransitOptionParams {
scaleUnits?: int64;

@doc("Transit Option Params remoteVirtualNetworkId.")
remoteVirtualNetworkId?: string;
remoteVirtualNetworkId?: VirtualNetworkResourceId;
}

@doc("TransitOption Properties")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ model SubnetConfiguration {

@doc("Subnet ID.")
@visibility(Lifecycle.Read)
id?: Azure.Core.armResourceIdentifier;
id?: SubnetResourceId;

@doc("Network prefix size.")
networkPrefixSize: int32;
Expand All @@ -55,7 +55,7 @@ model SubnetConfiguration {

@doc("Network security group ID.")
@visibility(Lifecycle.Read)
networkSecurityGroupId?: Azure.Core.armResourceIdentifier;
networkSecurityGroupId?: NsgResourceId;
}

@doc("Enclave Virtual Network Properties")
Expand Down Expand Up @@ -152,7 +152,7 @@ model VirtualEnclaveProperties {
enclaveDefaultSettings?: EnclaveDefaultSettings;

@doc("List of resource ids created by Virtual Enclave.")
resourceCollection?: string[];
resourceCollection?: armResourceIdentifier[];

#suppress "@azure-tools/typespec-providerhub/non-breaking-versioning" "New version does not have any breaking change."
@added(Microsoft.Mission.Versions.v2024_06_01_preview)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4482,7 +4482,7 @@
"description": "Request to the action call to check address space availability.",
"properties": {
"communityResourceId": {
"type": "string",
"$ref": "#/definitions/CommunityResourceId",
"description": "Resource Id of the Community"
},
"enclaveVirtualNetwork": {
Expand Down Expand Up @@ -6007,6 +6007,18 @@
}
}
},
"NsgResourceId": {
"type": "string",
"format": "arm-id",
"description": "A type definition that refers the id to an Azure Resource Manager resource.",
"x-ms-arm-id-details": {
"allowedResources": [
{
"type": "Microsoft.Network/networkSecurityGroups"
}
]
}
},
"Principal": {
"type": "object",
"description": "Principal for maintenance mode or role assignments",
Expand Down Expand Up @@ -6272,8 +6284,7 @@
"description": "Subnet name."
},
"id": {
"type": "string",
"format": "arm-id",
"$ref": "#/definitions/SubnetResourceId",
"description": "Subnet ID.",
"readOnly": true
},
Expand All @@ -6292,8 +6303,7 @@
"readOnly": true
},
"networkSecurityGroupId": {
"type": "string",
"format": "arm-id",
"$ref": "#/definitions/NsgResourceId",
"description": "Network security group ID.",
"readOnly": true
}
Expand All @@ -6303,6 +6313,18 @@
"networkPrefixSize"
]
},
"SubnetResourceId": {
"type": "string",
"format": "arm-id",
"description": "A type definition that refers the id to an Azure Resource Manager resource.",
"x-ms-arm-id-details": {
"allowedResources": [
{
"type": "Microsoft.Network/virtualNetworks/subnets"
}
]
}
},
"TransitHubPatchResource": {
"type": "object",
"description": "TH Patch Resource",
Expand Down Expand Up @@ -6461,7 +6483,7 @@
"description": "Transit Option Params scaleUnits."
},
"remoteVirtualNetworkId": {
"type": "string",
"$ref": "#/definitions/VirtualNetworkResourceId",
"description": "Transit Option Params remoteVirtualNetworkId."
}
}
Expand Down Expand Up @@ -6787,7 +6809,9 @@
"type": "array",
"description": "List of resource ids created by Virtual Enclave.",
"items": {
"type": "string"
"type": "string",
"format": "arm-id",
"description": "A type definition that refers the id to an Azure Resource Manager resource."
}
},
"managedResourceGroupConfiguration": {
Expand Down Expand Up @@ -6873,7 +6897,9 @@
"type": "array",
"description": "List of resource ids created by Virtual Enclave.",
"items": {
"type": "string"
"type": "string",
"format": "arm-id",
"description": "A type definition that refers the id to an Azure Resource Manager resource."
}
},
"managedResourceGroupConfiguration": {
Expand Down Expand Up @@ -6906,6 +6932,18 @@
]
}
},
"VirtualNetworkResourceId": {
"type": "string",
"format": "arm-id",
"description": "A type definition that refers the id to an Azure Resource Manager resource.",
"x-ms-arm-id-details": {
"allowedResources": [
{
"type": "Microsoft.Network/virtualNetworks"
}
]
}
},
"WorkloadPatchResource": {
"type": "object",
"description": "Workload Patch Resource",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5149,7 +5149,7 @@
"description": "Request to the action call to check address space availability.",
"properties": {
"communityResourceId": {
"type": "string",
"$ref": "#/definitions/CommunityResourceId",
"description": "Resource Id of the Community"
},
"enclaveVirtualNetwork": {
Expand Down Expand Up @@ -6694,6 +6694,18 @@
"approverEntraId"
]
},
"NsgResourceId": {
"type": "string",
"format": "arm-id",
"description": "A type definition that refers the id to an Azure Resource Manager resource.",
"x-ms-arm-id-details": {
"allowedResources": [
{
"type": "Microsoft.Network/networkSecurityGroups"
}
]
}
},
"Principal": {
"type": "object",
"description": "Principal for maintenance mode or role assignments",
Expand Down Expand Up @@ -6995,8 +7007,7 @@
"description": "Subnet name."
},
"id": {
"type": "string",
"format": "arm-id",
"$ref": "#/definitions/SubnetResourceId",
"description": "Subnet ID.",
"readOnly": true
},
Expand All @@ -7015,8 +7026,7 @@
"readOnly": true
},
"networkSecurityGroupId": {
"type": "string",
"format": "arm-id",
"$ref": "#/definitions/NsgResourceId",
"description": "Network security group ID.",
"readOnly": true
}
Expand All @@ -7026,6 +7036,18 @@
"networkPrefixSize"
]
},
"SubnetResourceId": {
"type": "string",
"format": "arm-id",
"description": "A type definition that refers the id to an Azure Resource Manager resource.",
"x-ms-arm-id-details": {
"allowedResources": [
{
"type": "Microsoft.Network/virtualNetworks/subnets"
}
]
}
},
"TransitHubPatchResource": {
"type": "object",
"description": "TH Patch Resource",
Expand Down Expand Up @@ -7184,7 +7206,7 @@
"description": "Transit Option Params scaleUnits."
},
"remoteVirtualNetworkId": {
"type": "string",
"$ref": "#/definitions/VirtualNetworkResourceId",
"description": "Transit Option Params remoteVirtualNetworkId."
}
}
Expand Down Expand Up @@ -7536,7 +7558,9 @@
"type": "array",
"description": "List of resource ids created by Virtual Enclave.",
"items": {
"type": "string"
"type": "string",
"format": "arm-id",
"description": "A type definition that refers the id to an Azure Resource Manager resource."
}
},
"managedResourceGroupConfiguration": {
Expand Down Expand Up @@ -7636,7 +7660,9 @@
"type": "array",
"description": "List of resource ids created by Virtual Enclave.",
"items": {
"type": "string"
"type": "string",
"format": "arm-id",
"description": "A type definition that refers the id to an Azure Resource Manager resource."
}
},
"managedResourceGroupConfiguration": {
Expand Down Expand Up @@ -7683,6 +7709,18 @@
]
}
},
"VirtualNetworkResourceId": {
"type": "string",
"format": "arm-id",
"description": "A type definition that refers the id to an Azure Resource Manager resource.",
"x-ms-arm-id-details": {
"allowedResources": [
{
"type": "Microsoft.Network/virtualNetworks"
}
]
}
},
"WorkloadPatchResource": {
"type": "object",
"description": "Workload Patch Resource",
Expand Down

0 comments on commit 1e335bf

Please sign in to comment.