UNPKG

@microsoft.azure/autorest.incubator

Version:
167 lines 5.68 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const components_1 = require("../../common/code-model/components"); const extensions_1 = require("../../common/code-model/extensions"); const dictionary_1 = require("../../common/dictionary"); class Encoding extends extensions_1.Extensions { constructor(initializer) { super(); this.headers = new dictionary_1.Dictionary(); this.apply(initializer); } } exports.Encoding = Encoding; class Header extends extensions_1.Extensions { constructor(initializer) { super(); this.content = new dictionary_1.Dictionary(); this.apply(initializer); } } exports.Header = Header; class MediaType extends extensions_1.Extensions { constructor(initializer) { super(); this.encoding = new dictionary_1.Dictionary(); this.accepts = new Array(); this.apply(initializer); } } exports.MediaType = MediaType; class RequestBody extends extensions_1.Extensions { constructor(initializer) { super(); this.apply(initializer); } } exports.RequestBody = RequestBody; class Response extends extensions_1.Extensions { constructor(description, initializer) { super(); this.description = description; this.content = new dictionary_1.Dictionary(); this.links = new dictionary_1.Dictionary(); this.headers = new dictionary_1.Dictionary(); this.apply(initializer); } } exports.Response = Response; var ParameterLocation; (function (ParameterLocation) { ParameterLocation["Query"] = "query"; ParameterLocation["Header"] = "header"; ParameterLocation["Cookie"] = "cookie"; ParameterLocation["Path"] = "path"; })(ParameterLocation = exports.ParameterLocation || (exports.ParameterLocation = {})); var EncodingStyle; (function (EncodingStyle) { EncodingStyle["Matrix"] = "matrix"; EncodingStyle["Label"] = "label"; EncodingStyle["Simple"] = "simple"; EncodingStyle["Form"] = "form"; EncodingStyle["SpaceDelimited"] = "spaceDelimited"; EncodingStyle["PipeDelimited"] = "pipeDelimited"; EncodingStyle["DeepObject"] = "deepObject"; })(EncodingStyle = exports.EncodingStyle || (exports.EncodingStyle = {})); var HttpMethod; (function (HttpMethod) { HttpMethod["Get"] = "get"; HttpMethod["Put"] = "put"; HttpMethod["Post"] = "post"; HttpMethod["Delete"] = "delete"; HttpMethod["Options"] = "options"; HttpMethod["Head"] = "head"; HttpMethod["Patch"] = "patch"; HttpMethod["Trace"] = "trace"; })(HttpMethod = exports.HttpMethod || (exports.HttpMethod = {})); class NewResponse extends extensions_1.Extensions { constructor(responseCode, description, mimeTypes, objectInitializer) { super(); this.responseCode = responseCode; this.description = description; this.mimeTypes = mimeTypes; this.details = { default: { isErrorResponse: false, description: 'MISSING DESCRIPTION 09', name: `${responseCode} ${mimeTypes.join(' ')}`, } }; this.headers = new dictionary_1.Dictionary(); this.apply(objectInitializer); } } exports.NewResponse = NewResponse; class HttpOperation extends extensions_1.Extensions { constructor(operationId, path, method, initializer) { super(); this.path = path; this.method = method; this.tags = new Array(); this.parameters = new Array(); //public responses = new Dictionary<Response>(); this.responses_new = new dictionary_1.Dictionary(); this.callbacks = new dictionary_1.Dictionary(); this.security = new Array(); this.servers = new Array(); this.deprecated = false; this.details = { default: { description: 'MISSING DESCRIPTION 05', name: operationId, } }; this.apply(initializer); } } exports.HttpOperation = HttpOperation; class HttpOperationParameter extends extensions_1.Extensions { constructor(name, inWhere, implementation, initializer) { super(); this.name = name; this.deprecated = false; this.required = false; this.allowEmptyValue = false; this.in = inWhere; this.details = { default: { description: 'MISSING DESCRIPTION 06', location: implementation, name, } }; this.required = inWhere === ParameterLocation.Path; this.apply(initializer); } } exports.HttpOperationParameter = HttpOperationParameter; function isHttpOperation(operation) { if (operation.path) { return true; } return false; } exports.isHttpOperation = isHttpOperation; class Callback { constructor() { } } exports.Callback = Callback; class HttpComponents extends components_1.Components { //operations = new Dictionary<HttpOperation>(); // // parameters = new Dictionary<HttpOperationParameter>(); constructor(initializer) { super(); this.responses = new dictionary_1.Dictionary(); this.examples = new dictionary_1.Dictionary(); this.requestBodies = new dictionary_1.Dictionary(); this.headers = new dictionary_1.Dictionary(); this.securitySchemes = new dictionary_1.Dictionary(); this.links = new dictionary_1.Dictionary(); this.callbacks = new dictionary_1.Dictionary(); this.apply(initializer); } } exports.HttpComponents = HttpComponents; //# sourceMappingURL=http-operation.js.map