UNPKG

@autorest/powershell

Version:
38 lines 1.43 kB
"use strict"; /*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ Object.defineProperty(exports, "__esModule", { value: true }); exports.Char = void 0; const clientruntime_1 = require("../clientruntime"); const codemodel_1 = require("@autorest/codemodel"); const primitive_1 = require("./primitive"); class Char extends primitive_1.NewPrimitive { constructor(schema, isRequired) { super(schema); this.isRequired = isRequired; this.isXmlAttribute = false; this.jsonType = clientruntime_1.ClientRuntime.JsonString; this.choices = schema.type === codemodel_1.SchemaType.Choice ? schema.choices : undefined; } get declaration() { return `char${this.isRequired ? '' : ' ?'}`; } get convertObjectMethod() { return 'global::System.Convert.Char'; } validateValue(eventListener, property) { return ` ${this.validateEnum(property)} `.trim(); } validateEnum(property) { if (!this.choices) { return ''; } return '// todo validate enum choices'; } } exports.Char = Char; //# sourceMappingURL=char.js.map