@azure-tools/codemodel-v3
Version:
AutoRest code model library
104 lines • 3.66 kB
JavaScript
"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.Tag = exports.ServerVariable = exports.Server = exports.Link = exports.ExternalDocumentation = exports.Example = exports.ImplementationLocation = exports.Components = exports.IParameter = void 0;
const extensions_1 = require("./extensions");
const uid_1 = require("./uid");
const linq_1 = require("@azure-tools/linq");
class IParameter extends extensions_1.Extensions {
constructor(name, schema, initializer) {
super();
this.name = name;
this.schema = schema;
this.description = '';
this.deprecated = false;
this.required = false;
this.details = {
default: {
uid: `parameter:${uid_1.uid()}`,
description: this.description,
name,
}
};
this.allowEmptyValue = false;
this.apply(initializer);
}
}
exports.IParameter = IParameter;
class Components extends extensions_1.Extensions {
constructor(initializer) {
super();
/**
* Dictionary of Operations in this model.
*
* This is intended to invert the original PathItems in the OAI model, and focus on operations, not endpoints.
*/
this.operations = new linq_1.Dictionary();
this.apply(initializer);
}
}
exports.Components = Components;
var ImplementationLocation;
(function (ImplementationLocation) {
ImplementationLocation["Method"] = "Method";
ImplementationLocation["Client"] = "Client";
})(ImplementationLocation = exports.ImplementationLocation || (exports.ImplementationLocation = {}));
class Example extends extensions_1.Extensions {
constructor(initializer) {
super();
this.extensions = new linq_1.Dictionary();
this.apply(initializer);
}
}
exports.Example = Example;
class ExternalDocumentation extends extensions_1.Extensions {
constructor(url, initializer) {
super();
this.url = url;
this.extensions = new linq_1.Dictionary();
this.apply(initializer);
}
}
exports.ExternalDocumentation = ExternalDocumentation;
class Link extends extensions_1.Extensions {
constructor(initializer) {
super();
this.extensions = new linq_1.Dictionary();
this.parameters = new linq_1.Dictionary();
this.apply(initializer);
}
}
exports.Link = Link;
class Server extends extensions_1.Extensions {
constructor(url, initializer) {
super();
this.url = url;
this.extensions = new linq_1.Dictionary();
this.variables = new linq_1.Dictionary();
this.apply(initializer);
}
}
exports.Server = Server;
class ServerVariable extends extensions_1.Extensions {
constructor(defaultValue, initializer) {
super();
this.extensions = new linq_1.Dictionary();
this.enum = new Array();
this.default = defaultValue;
this.apply(initializer);
}
}
exports.ServerVariable = ServerVariable;
class Tag extends extensions_1.Extensions {
constructor(name, initializer) {
super();
this.name = name;
this.extensions = new linq_1.Dictionary();
this.apply(initializer);
}
}
exports.Tag = Tag;
//# sourceMappingURL=components.js.map