Skip to content

Commit

Permalink
[Microsoft.DeviceRegistry] Moved to single TypeSpec project (#28198)
Browse files Browse the repository at this point in the history
* Moved to single TypeSpec project

* Regenerated spec with latest TypeSpec compiler version

* Added doc
  • Loading branch information
davidemontanari authored Mar 19, 2024
1 parent dd742c6 commit 9549a0e
Show file tree
Hide file tree
Showing 46 changed files with 793 additions and 1,153 deletions.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import "@typespec/versioning";
import "@azure-tools/typespec-providerhub";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "../common/extendedLocation.tsp";
import "../common/provisioningState.tsp";
import "./common/extendedLocation.tsp";
import "./common/provisioningState.tsp";

using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.ResourceManager;
using OpenAPI;

Expand Down Expand Up @@ -117,19 +118,19 @@ model OwnCertificate {
@armResourceOperations
interface AssetEndpointProfiles {
@Autorest.example(
"./examples/assetEndpointProfiles/Get_AssetEndpointProfile.json",
"./examples/Get_AssetEndpointProfile.json",
"Get an Asset Endpoint Profile."
)
get is ArmResourceRead<AssetEndpointProfile>;

@Autorest.example(
"./examples/assetEndpointProfiles/Create_AssetEndpointProfile.json",
"./examples/Create_AssetEndpointProfile.json",
"Create an Asset Endpoint Profile."
)
createOrReplace is ArmResourceCreateOrReplaceAsync<AssetEndpointProfile>;

@Autorest.example(
"./examples/assetEndpointProfiles/Update_AssetEndpointProfile.json",
"./examples/Update_AssetEndpointProfile.json",
"Patch an Asset Endpoint Profile."
)
update is ArmResourcePatchAsync<
Expand All @@ -138,19 +139,19 @@ interface AssetEndpointProfiles {
>;

@Autorest.example(
"./examples/assetEndpointProfiles/Delete_AssetEndpointProfile.json",
"./examples/Delete_AssetEndpointProfile.json",
"Delete an Asset Endpoint Profile."
)
delete is ArmResourceDeleteWithoutOkAsync<AssetEndpointProfile>;

@Autorest.example(
"./examples/assetEndpointProfiles/List_AssetEndpointProfiles_ResourceGroup.json",
"./examples/List_AssetEndpointProfiles_ResourceGroup.json",
"List Asset Endpoint Profiles in a Resource Group."
)
listByResourceGroup is ArmResourceListByParent<AssetEndpointProfile>;

@Autorest.example(
"./examples/assetEndpointProfiles/List_AssetEndpointProfiles_Subscription.json",
"./examples/List_AssetEndpointProfiles_Subscription.json",
"List Asset Endpoint Profiles in a Subscription."
)
listBySubscription is ArmListBySubscription<AssetEndpointProfile>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import "@typespec/versioning";
import "@azure-tools/typespec-providerhub";
import "@azure-tools/typespec-azure-core";
import "@azure-tools/typespec-azure-resource-manager";
import "../common/extendedLocation.tsp";
import "../common/provisioningState.tsp";
import "./common/extendedLocation.tsp";
import "./common/provisioningState.tsp";

using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.ResourceManager;
using OpenAPI;

Expand Down Expand Up @@ -199,41 +200,41 @@ model AssetStatusError {

@armResourceOperations
interface Assets {
@Autorest.example("./examples/assets/Get_Asset.json", "Get an Asset")
@Autorest.example("./examples/Get_Asset.json", "Get an Asset")
@Autorest.example(
"./examples/assets/Get_Asset_With_SyncStatus.json",
"./examples/Get_Asset_With_SyncStatus.json",
"Get an Asset with Sync Status."
)
get is ArmResourceRead<Asset>;

@Autorest.example(
"./examples/assets/Create_Asset_With_ExternalAssetId.json",
"./examples/Create_Asset_With_ExternalAssetId.json",
"Create an Asset With External Asset Id."
)
@Autorest.example(
"./examples/assets/Create_Asset_Without_ExternalAssetId.json",
"./examples/Create_Asset_Without_ExternalAssetId.json",
"Create an Asset Without External Asset Id."
)
@Autorest.example(
"./examples/assets/Create_Asset_Without_DisplayName.json",
"./examples/Create_Asset_Without_DisplayName.json",
"Create an Asset Without Display Name."
)
createOrReplace is ArmResourceCreateOrReplaceAsync<Asset>;

@Autorest.example("./examples/assets/Update_Asset.json", "Patch an Asset.")
@Autorest.example("./examples/Update_Asset.json", "Patch an Asset.")
update is ArmResourcePatchAsync<Asset, AssetProperties>;

@Autorest.example("./examples/assets/Delete_Asset.json", "Delete an Asset.")
@Autorest.example("./examples/Delete_Asset.json", "Delete an Asset.")
delete is ArmResourceDeleteWithoutOkAsync<Asset>;

@Autorest.example(
"./examples/assets/List_Assets_ResourceGroup.json",
"./examples/List_Assets_ResourceGroup.json",
"List Assets in a Resource Group."
)
listByResourceGroup is ArmResourceListByParent<Asset>;

@Autorest.example(
"./examples/assets/List_Assets_Subscription.json",
"./examples/List_Assets_Subscription.json",
"List Assets in a Subscription."
)
listBySubscription is ArmListBySubscription<Asset>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import "@typespec/rest";
import "@typespec/versioning";
import "@azure-tools/typespec-providerhub";
import "@azure-tools/typespec-azure-resource-manager";
import "./assets.tsp";
import "./assetEndpointProfiles.tsp";

using TypeSpec.Http;
using TypeSpec.Rest;
Expand All @@ -15,15 +17,17 @@ using Azure.ResourceManager.Foundations;
@service({
title: "Microsoft.DeviceRegistry management service",
})
@versioned(Versions)
@versioned(Microsoft.DeviceRegistry.Versions)
@doc("Microsoft.DeviceRegistry Resource Provider management API.")
namespace Microsoft.DeviceRegistry;

/** Api versions */
/** API versions */
@doc("Microsoft.DeviceRegistry Resource Provider supported API versions.")
enum Versions {
/** 2023-11-01-preview preview version */
@doc("Microsoft.DeviceRegistry Resource Provider management API version 2023-11-01-preview.")
@useDependency(Azure.ResourceManager.Versions.v1_0_Preview_1)
`2023-11-01-preview`,
@armCommonTypesVersion(Azure.ResourceManager.CommonTypes.Versions.v3)
v2023_11_01_preview: "2023-11-01-preview",
}

interface Operations extends Azure.ResourceManager.Operations {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ options:
"@azure-tools/typespec-autorest":
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/operations.json"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/deviceregistry.json"
examples-directory: "{project-root}/examples"
use-read-only-status-schema: true
omit-unreachable-types: true
Expand Down
Loading

0 comments on commit 9549a0e

Please sign in to comment.