-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mobo to TypeSpec-Azure common types (#1482)
Issue: #1160 Starting with mobo.json: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/common-types/resource-management/v5/mobo.json
- Loading branch information
1 parent
cc0ac4f
commit 2d7c279
Showing
8 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
.chronus/changes/almend-AddMissingComponents-2024-8-5-9-51-50.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
changeKind: feature | ||
packages: | ||
- "@azure-tools/typespec-azure-resource-manager" | ||
--- | ||
|
||
Add mobo type to TypeSpec-Azure common types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"swagger": "2.0", | ||
"info": { | ||
"title": "Common types", | ||
"version": "v5" | ||
}, | ||
"paths": {}, | ||
"definitions": { | ||
"ManagedOnBehalfOfConfiguration": { | ||
"type": "object", | ||
"description": "Managed-On-Behalf-Of configuration properties. This configuration exists for the resources where a resource provider manages those resources on behalf of the resource owner.", | ||
"properties": { | ||
"moboBrokerResources": { | ||
"type": "array", | ||
"description": "Managed-On-Behalf-Of broker resources", | ||
"items": { | ||
"$ref": "#/definitions/MoboBrokerResource" | ||
}, | ||
"readOnly": true, | ||
"x-ms-identifiers": [ | ||
"id" | ||
] | ||
} | ||
} | ||
}, | ||
"MoboBrokerResource": { | ||
"type": "object", | ||
"description": "Managed-On-Behalf-Of broker resource. This resource is created by the Resource Provider to manage some resources on behalf of the user.", | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"format": "arm-id", | ||
"description": "Resource identifier of a Managed-On-Behalf-Of broker resource" | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import "./base.tsp"; | ||
|
||
import "../../node_modules/@azure-tools/typespec-azure-resource-manager/lib/common-types/mobo.tsp"; | ||
|
||
using OpenAPI; | ||
|
||
namespace Azure.ResourceManager.CommonTypes; | ||
|
||
@@extension(ManagedOnBehalfOfConfiguration.moboBrokerResources, "x-ms-identifiers", ["id"]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/typespec-azure-resource-manager/lib/common-types/mobo.tsp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Azure.Core; | ||
using TypeSpec.Versioning; | ||
|
||
namespace Azure.ResourceManager.CommonTypes; | ||
|
||
/** Managed-On-Behalf-Of configuration properties. This configuration exists for the resources where a resource provider manages those resources on behalf of the resource owner. */ | ||
@added(Versions.v5) | ||
model ManagedOnBehalfOfConfiguration { | ||
/** Managed-On-Behalf-Of broker resources */ | ||
@visibility("read") | ||
moboBrokerResources?: MoboBrokerResource[]; | ||
} | ||
|
||
/** Managed-On-Behalf-Of broker resource. This resource is created by the Resource Provider to manage some resources on behalf of the user. */ | ||
@added(Versions.v5) | ||
model MoboBrokerResource { | ||
/** Resource identifier of a Managed-On-Behalf-Of broker resource */ | ||
id?: Azure.Core.armResourceIdentifier; | ||
} |