From 209df41318386f0f8ebfc7882c5896b70979f109 Mon Sep 17 00:00:00 2001 From: changlong-liu <59815250+changlong-liu@users.noreply.github.com> Date: Fri, 6 Nov 2020 14:04:47 +0800 Subject: [PATCH] resource-type (#101) * resource-type * version 0.5.6 Co-authored-by: Changlong Liu --- doc/cli-directive.md | 9 +++++++++ package.json | 2 +- src/nodeHelper.ts | 1 + src/plugins/modifier/cliDirectiveAction.ts | 1 + 4 files changed, 12 insertions(+), 1 deletion(-) diff --git a/doc/cli-directive.md b/doc/cli-directive.md index 98805cf..bec40ea 100644 --- a/doc/cli-directive.md +++ b/doc/cli-directive.md @@ -94,6 +94,8 @@ For groupName, operationName, parameterName, typeName, propertyName, usually you - add 'min-api: ..." under 'language->cli' - max-api: - add 'max-api: ..." under 'language->cli' +- resource-type: + - add 'resource-type: ..." under 'language->cli' - value: - set static value for example dotPath - eval: @@ -222,6 +224,13 @@ cli: op: CreateOrUpdate#Update param: properties cli-flatten: true + # set resource-type/max-api/min-api + - where: + group: OperationGroupName + op: Delete + - max-api: '2019-01-01' + - max-api: '2018-01-01' + - resource-type: 'DATA_STORAGE_BLOB' # set example content with static value - where: exampleName: TheExampleName diff --git a/package.json b/package.json index 53073d7..3a55a36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@autorest/clicommon", - "version": "0.5.5", + "version": "0.5.6", "description": "Autorest Azure Cli Common Module", "main": "dist/index.js", "engines": { diff --git a/src/nodeHelper.ts b/src/nodeHelper.ts index fb25834..a730055 100644 --- a/src/nodeHelper.ts +++ b/src/nodeHelper.ts @@ -19,6 +19,7 @@ export class NodeCliHelper { public static readonly CLI_FLATTEN_TRACE: string = 'cliFlattenTrace'; public static readonly CLI_MIN_API: string = 'min-api'; public static readonly CLI_MAX_API: string = 'max-api'; + public static readonly CLI_RESOURCE_TYPE: string = 'resource-type'; private static readonly CLI: string = "cli"; private static readonly NAME: string = "name"; diff --git a/src/plugins/modifier/cliDirectiveAction.ts b/src/plugins/modifier/cliDirectiveAction.ts index 2a53a51..dbaf922 100644 --- a/src/plugins/modifier/cliDirectiveAction.ts +++ b/src/plugins/modifier/cliDirectiveAction.ts @@ -42,6 +42,7 @@ export abstract class Action { case NodeCliHelper.SPLIT_OPERATION_NAMES: case NodeCliHelper.CLI_MIN_API: case NodeCliHelper.CLI_MAX_API: + case NodeCliHelper.CLI_RESOURCE_TYPE: arr.push(new ActionSetProperty(value, key, () => null)); break; case 'delete':