@autorest/powershell
Version:
AutoRest PowerShell Cmdlet Generator
50 lines • 2.6 kB
TypeScript
import { Operation, Parameter } from '@autorest/codemodel';
import { AutorestExtensionHost as Host } from '@autorest/extension-base';
import { PwshModel } from '../utils/PwshModel';
import { ModelState } from '../utils/model-state';
import { CommandOperation, CommandType } from '../utils/command-operation';
type State = ModelState<PwshModel>;
export declare function titleToAzureServiceName(title: string): string;
interface CommandVariant {
alias: Array<string>;
verb: string;
subject: string;
subjectPrefix: string;
variant: string;
action: string;
}
export declare class Inferrer {
private state;
commonParameters: string[];
verbMap: {
[operationIdMethod: string]: string;
};
prefix: string;
serviceName: string;
subjectPrefix: string;
isAzure: boolean;
supportJsonInput: boolean;
constructor(state: State);
init(): Promise<this>;
createCommands(): Promise<PwshModel>;
/**
* Judge if the response of get operation can be piped as the input of put operation
* 1. there is only one put request schema
* 2. get operation response schema type is the same as put operation request schema type
*/
private supportsGetPut;
private containsIdentityType;
private IsManagedIdentityOperation;
inferCommand(operation: Array<string>, group: string, suffix?: Array<string>): Array<CommandVariant>;
inferCommandNames(op: Operation, group: string, state: State): Promise<Array<CommandVariant>>;
addVariant(vname: string, body: Parameter | null, bodyParameterName: string, parameters: Array<Parameter>, operation: Operation, variant: CommandVariant, state: State, preOperations: Array<Operation> | undefined, commandType?: CommandType): Promise<CommandOperation>;
operationIdentities: Set<string>;
addCommandOperation(vname: string, parameters: Array<Parameter>, operation: Operation, variant: CommandVariant, state: State, preOperations: Array<Operation> | undefined, commandType?: CommandType): Promise<CommandOperation>;
addVariants(parameters: Array<Parameter> | undefined, operation: Operation, variant: CommandVariant, vname: string, state: State, preOperations?: Array<Operation>, commandType?: CommandType): Promise<void>;
reservedPathParam: Set<string>;
createCommandVariant(action: string, subject: Array<string>, variant: Array<string>, model: PwshModel): CommandVariant;
getPowerShellVerb(action: string): string;
}
export declare function createCommandsV2(service: Host): Promise<void>;
export {};
//# sourceMappingURL=create-commands-v2.d.ts.map