UNPKG

@autorest/powershell

Version:
25 lines 1.17 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.Uri = void 0; const codegen_1 = require("@azure-tools/codegen"); const string_1 = require("./string"); class Uri extends string_1.String { constructor(schema, isRequired) { super(schema, isRequired); } get declaration() { return 'string'; } validatePresence(eventListener, property) { return this.isRequired ? `await ${eventListener}.AssertNotNull(${(0, codegen_1.nameof)(property.value)},${property});`.trim() : ''; } validateValue(eventListener, property) { return `await ${eventListener}.AssertRegEx(${(0, codegen_1.nameof)(property.value)},${property},@"^[0-9a-fA-F]{8}(-[0-9a-fA-F]{4}){3}-[0-9a-fA-F]{12}$");`; } } exports.Uri = Uri; //# sourceMappingURL=uri.js.map