Skip to content

Commit

Permalink
[Microsoft.DeviceRegistry] Fixed operationIds in examples for API ver…
Browse files Browse the repository at this point in the history
…sion 2023-11-01-preview (#28842)

* Fixed operationIds in examples

* Removed @Autorest.example decorator.

* Added examples descriptions
  • Loading branch information
davidemontanari committed May 10, 2024
1 parent 68c8da6 commit ac882a9
Show file tree
Hide file tree
Showing 38 changed files with 87 additions and 109 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,42 +118,18 @@ model OwnCertificate {

@armResourceOperations
interface AssetEndpointProfiles {
@Autorest.example(
"./examples/Get_AssetEndpointProfile.json",
"Get an Asset Endpoint Profile."
)
get is ArmResourceRead<AssetEndpointProfile>;

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

@Autorest.example(
"./examples/Update_AssetEndpointProfile.json",
"Patch an Asset Endpoint Profile."
)
update is ArmResourcePatchAsync<
AssetEndpointProfile,
AssetEndpointProfileProperties
>;

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

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

@Autorest.example(
"./examples/List_AssetEndpointProfiles_Subscription.json",
"List Asset Endpoint Profiles in a Subscription."
)
listBySubscription is ArmListBySubscription<AssetEndpointProfile>;
}
27 changes: 0 additions & 27 deletions specification/deviceregistry/DeviceRegistry.Management/assets.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -203,42 +203,15 @@ model AssetStatusError {

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

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

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

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

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

@Autorest.example(
"./examples/List_Assets_Subscription.json",
"List Assets in a Subscription."
)
listBySubscription is ArmListBySubscription<Asset>;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"operationId": "Create_AssetEndpointProfile",
"title": "Create_AssetEndpointProfile",
"operationId": "AssetEndpointProfiles_CreateOrReplace",
"description": "Create an Asset Endpoint Profile",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"title": "Create_Asset_With_ExternalAssetId",
"operationId": "Create_Asset_With_ExternalAssetId",
"operationId": "Assets_CreateOrReplace",
"description": "Create an Asset With External Asset Id",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"title": "Create_Asset_Without_DisplayName",
"operationId": "Create_Asset_Without_DisplayName",
"operationId": "Assets_CreateOrReplace",
"description": "Create an Asset Without Display Name",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"title": "Create_Asset_Without_ExternalAssetId",
"operationId": "Create_Asset_Without_ExternalAssetId",
"operationId": "Assets_CreateOrReplace",
"description": "Create an Asset Without External Asset Id",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"title": "Delete_Asset",
"operationId": "Delete_Asset",
"operationId": "Assets_Delete",
"description": "Delete an Asset",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"operationId": "Delete_AssetEndpointProfile",
"title": "Delete_AssetEndpointProfile",
"operationId": "AssetEndpointProfiles_Delete",
"description": "Delete an Asset Endpoint Profile",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"title": "Get_Asset",
"operationId": "Get_Asset",
"operationId": "Assets_Get",
"description": "Get an Asset",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"operationId": "Get_AssetEndpointProfile",
"title": "Get_AssetEndpointProfile",
"operationId": "AssetEndpointProfiles_Get",
"description": "Get an Asset Endpoint Profile",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"title": "Get_Asset_With_SyncStatus",
"operationId": "Get_Asset_With_SyncStatus",
"operationId": "Assets_Get",
"description": "Get an Asset with Sync Status",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"title": "Get_OperationStatus",
"operationId": "Get_OperationStatus",
"operationId": "OperationStatus_Get",
"description": "Get the status of an async operation",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"operationId": "List_AssetEndpointProfiles_ResourceGroup",
"title": "List_AssetEndpointProfiles_ResourceGroup",
"operationId": "AssetEndpointProfiles_ListByResourceGroup",
"description": "List Asset Endpoint Profiles in a Resource Group",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"operationId": "List_AssetEndpointProfiles_Subscription",
"title": "List_AssetEndpointProfiles_Subscription",
"operationId": "AssetEndpointProfiles_ListBySubscription",
"description": "List Asset Endpoint Profiles in a Subscription",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"title": "List_Assets_ResourceGroup",
"operationId": "List_Assets_ResourceGroup",
"operationId": "Assets_ListByResourceGroup",
"description": "List Assets in a Resource Group",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"title": "List_Assets_Subscription",
"operationId": "List_Assets_Subscription",
"operationId": "Assets_ListBySubscription",
"description": "List Assets in a Subscription",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"title": "List_Operations",
"operationId": "List_Operations",
"operationId": "Operations_List",
"description": "Returns list of operations",
"parameters": {
"api-version": "2023-11-01-preview"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"title": "Update_Asset",
"operationId": "Update_Asset",
"operationId": "Assets_Update",
"description": "Patch an Asset",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"operationId": "Update_AssetEndpointProfile",
"title": "Update_AssetEndpointProfile",
"operationId": "AssetEndpointProfiles_Update",
"description": "Patch an Asset Endpoint Profile",
"parameters": {
"api-version": "2023-11-01-preview",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,11 @@ enum Versions {

interface Operations extends Azure.ResourceManager.Operations {}

@@Autorest.example(Operations.list,
"./examples/List_Operations.json",
"Returns list of operations."
);

@armResourceOperations
interface OperationStatus {
@doc("Returns the current status of an async operation.")
@autoRoute
@armUpdateProviderNamespace
@Autorest.example(
"./examples/Get_OperationStatus.json",
"Get the status of an async operation."
)
get(
...ApiVersionParameter,
...SubscriptionIdParameter,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
}
},
"x-ms-examples": {
"Returns list of operations.": {
"List_Operations": {
"$ref": "./examples/List_Operations.json"
}
},
Expand Down Expand Up @@ -119,7 +119,7 @@
}
},
"x-ms-examples": {
"List Asset Endpoint Profiles in a Subscription.": {
"List_AssetEndpointProfiles_Subscription": {
"$ref": "./examples/List_AssetEndpointProfiles_Subscription.json"
}
},
Expand Down Expand Up @@ -158,7 +158,7 @@
}
},
"x-ms-examples": {
"List Assets in a Subscription.": {
"List_Assets_Subscription": {
"$ref": "./examples/List_Assets_Subscription.json"
}
},
Expand Down Expand Up @@ -203,7 +203,7 @@
}
},
"x-ms-examples": {
"Get the status of an async operation.": {
"Get_OperationStatus": {
"$ref": "./examples/Get_OperationStatus.json"
}
}
Expand Down Expand Up @@ -242,7 +242,7 @@
}
},
"x-ms-examples": {
"List Asset Endpoint Profiles in a Resource Group.": {
"List_AssetEndpointProfiles_ResourceGroup": {
"$ref": "./examples/List_AssetEndpointProfiles_ResourceGroup.json"
}
},
Expand Down Expand Up @@ -294,7 +294,7 @@
}
},
"x-ms-examples": {
"Get an Asset Endpoint Profile.": {
"Get_AssetEndpointProfile": {
"$ref": "./examples/Get_AssetEndpointProfile.json"
}
}
Expand Down Expand Up @@ -363,7 +363,7 @@
}
},
"x-ms-examples": {
"Create an Asset Endpoint Profile.": {
"Create_AssetEndpointProfile": {
"$ref": "./examples/Create_AssetEndpointProfile.json"
}
},
Expand Down Expand Up @@ -437,7 +437,7 @@
}
},
"x-ms-examples": {
"Patch an Asset Endpoint Profile.": {
"Update_AssetEndpointProfile": {
"$ref": "./examples/Update_AssetEndpointProfile.json"
}
},
Expand Down Expand Up @@ -499,7 +499,7 @@
}
},
"x-ms-examples": {
"Delete an Asset Endpoint Profile.": {
"Delete_AssetEndpointProfile": {
"$ref": "./examples/Delete_AssetEndpointProfile.json"
}
},
Expand Down Expand Up @@ -542,7 +542,7 @@
}
},
"x-ms-examples": {
"List Assets in a Resource Group.": {
"List_Assets_ResourceGroup": {
"$ref": "./examples/List_Assets_ResourceGroup.json"
}
},
Expand Down Expand Up @@ -594,10 +594,10 @@
}
},
"x-ms-examples": {
"Get an Asset": {
"Get_Asset": {
"$ref": "./examples/Get_Asset.json"
},
"Get an Asset with Sync Status.": {
"Get_Asset_With_SyncStatus": {
"$ref": "./examples/Get_Asset_With_SyncStatus.json"
}
}
Expand Down Expand Up @@ -666,13 +666,13 @@
}
},
"x-ms-examples": {
"Create an Asset With External Asset Id.": {
"Create_Asset_With_ExternalAssetId": {
"$ref": "./examples/Create_Asset_With_ExternalAssetId.json"
},
"Create an Asset Without Display Name.": {
"Create_Asset_Without_DisplayName": {
"$ref": "./examples/Create_Asset_Without_DisplayName.json"
},
"Create an Asset Without External Asset Id.": {
"Create_Asset_Without_ExternalAssetId": {
"$ref": "./examples/Create_Asset_Without_ExternalAssetId.json"
}
},
Expand Down Expand Up @@ -746,7 +746,7 @@
}
},
"x-ms-examples": {
"Patch an Asset.": {
"Update_Asset": {
"$ref": "./examples/Update_Asset.json"
}
},
Expand Down Expand Up @@ -808,7 +808,7 @@
}
},
"x-ms-examples": {
"Delete an Asset.": {
"Delete_Asset": {
"$ref": "./examples/Delete_Asset.json"
}
},
Expand Down

0 comments on commit ac882a9

Please sign in to comment.