"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * Octane API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (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.MeasurementsApi = void 0;
const runtime = __importStar(require("../runtime"));
const models_1 = require("../models");
/**
 *
 */
class MeasurementsApi extends runtime.BaseAPI {
    /**
     * Send Batched Measurements
     */
    async measurementsMultiPostRaw(requestParameters, initOverrides) {
        if (requestParameters.measurement === null || requestParameters.measurement === undefined) {
            throw new runtime.RequiredError('measurement', 'Required parameter requestParameters.measurement was null or undefined when calling measurementsMultiPost.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/measurements/multi`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: requestParameters.measurement.map(models_1.MeasurementToJSON),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.MeasurementFromJSON));
    }
    /**
     * Send Batched Measurements
     */
    async measurementsMultiPost(requestParameters, initOverrides) {
        const response = await this.measurementsMultiPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Send Measurement
     */
    async measurementsPostRaw(requestParameters, initOverrides) {
        if (requestParameters.measurement === null || requestParameters.measurement === undefined) {
            throw new runtime.RequiredError('measurement', 'Required parameter requestParameters.measurement was null or undefined when calling measurementsPost.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/measurements/`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.MeasurementToJSON)(requestParameters.measurement),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.MeasurementFromJSON)(jsonValue));
    }
    /**
     * Send Measurement
     */
    async measurementsPost(requestParameters, initOverrides) {
        const response = await this.measurementsPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
exports.MeasurementsApi = MeasurementsApi;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWVhc3VyZW1lbnRzQXBpLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2NvZGVnZW4vYXBpcy9NZWFzdXJlbWVudHNBcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLG9CQUFvQjtBQUNwQixvQkFBb0I7QUFDcEI7Ozs7Ozs7Ozs7R0FVRzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUdILG9EQUFzQztBQUN0QyxzQ0FJbUI7QUFVbkI7O0dBRUc7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