UNPKG

@microsoft.azure/autorest.incubator

Version:
20 lines 803 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const text_manipulation_1 = require("../../common/text-manipulation"); const string_1 = require("../../csharp/schema/string"); class Uuid extends string_1.String { constructor(schema, isRequired) { super(schema, isRequired); } get declaration() { return `string`; } validatePresence(property) { return this.isRequired ? `await listener.AssertNotNull(${text_manipulation_1.nameof(property.value)},${property});`.trim() : ''; } validateValue(property) { return `await listener.AssertRegEx(${text_manipulation_1.nameof(property.value)},${property},@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$");`; } } exports.Uuid = Uuid; //# sourceMappingURL=Uuid.js.map