UNPKG

applicationinsights

Version:
95 lines 3.53 kB
"use strict"; /* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ApplicationInsightsClient = void 0; const coreClient = __importStar(require("@azure/core-client")); const Parameters = __importStar(require("./models/parameters")); const Mappers = __importStar(require("./models/mappers")); const applicationInsightsClientContext_1 = require("./applicationInsightsClientContext"); class ApplicationInsightsClient extends applicationInsightsClientContext_1.ApplicationInsightsClientContext { /** * Initializes a new instance of the ApplicationInsightsClient class. * @param options The parameter options */ constructor(options) { super(options); } /** * This operation sends a sequence of telemetry events that will be monitored by Azure Monitor. * @param body The list of telemetry events to track. * @param options The options parameters. */ track(body, options) { return this.sendOperationRequest({ body, options }, trackOperationSpec); } } exports.ApplicationInsightsClient = ApplicationInsightsClient; // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const trackOperationSpec = { path: "/track", httpMethod: "POST", responses: { 200: { bodyMapper: Mappers.TrackResponse, }, 206: { bodyMapper: Mappers.TrackResponse, }, 400: { bodyMapper: Mappers.TrackResponse, isError: true, }, 402: { bodyMapper: Mappers.TrackResponse, isError: true, }, 429: { bodyMapper: Mappers.TrackResponse, isError: true, }, 500: { bodyMapper: Mappers.TrackResponse, isError: true, }, 503: { bodyMapper: Mappers.TrackResponse, isError: true, }, }, requestBody: Parameters.body, urlParameters: [Parameters.host], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, }; //# sourceMappingURL=applicationInsightsClient.js.map