"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
const linq_1 = require("@azure-tools/linq");
const codegen_csharp_1 = require("@azure-tools/codegen-csharp");
const exports_1 = require("../llcsharp/exports");
const class_1 = require("./class");
class CmdletNamespace extends codegen_csharp_1.Namespace {
    constructor(parent, state, objectInitializer) {
        super('Cmdlets', parent);
        this.state = state;
        this.inputModels = new Array();
        this.apply(objectInitializer);
    }
    get outputFolder() {
        return this.state.project.cmdletFolder;
    }
    async init() {
        this.add(new codegen_csharp_1.ImportDirective(`static ${exports_1.ClientRuntime.Extensions}`));
        this.add(new codegen_csharp_1.ImportDirective(`System`));
        // generate cmdlet classes on top of the SDK
        for (const { key: index, value: operation } of linq_1.items(this.state.model.commands.operations)) {
            // skip ViaIdentity for set-* cmdlets.
            if (this.state.project.azure && operation.details.csharp.verb === 'Set' && operation.details.csharp.name.indexOf('ViaIdentity') > 0) {
                continue;
            }
            this.addClass(await new class_1.CmdletClass(this, operation, this.state.path('commands', 'operations', index)).init());
        }
        return this;
    }
}
exports.CmdletNamespace = CmdletNamespace;
//# sourceMappingURL=namespace.js.map