"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: all[name]
    });
}
_export(exports, {
    constructHeaders: function() {
        return constructHeaders;
    },
    validateLogin: function() {
        return validateLogin;
    }
});
const _octoprintserviceconstants = require("../constants/octoprint-service.constants");
const _runtimeexceptions = require("../../../exceptions/runtime.exceptions");
function validateLogin(login) {
    if (!login.apiKey || !login.printerURL) {
        throw new _runtimeexceptions.ValidationException("printer apiKey or printerURL undefined");
    }
    return {
        apiKey: login.apiKey,
        printerURL: login.printerURL
    };
}
function constructHeaders(apiKey, contentType = _octoprintserviceconstants.jsonContentType) {
    return {
        [_octoprintserviceconstants.contentTypeHeaderKey]: contentType,
        [_octoprintserviceconstants.apiKeyHeaderKey]: apiKey
    };
}

//# sourceMappingURL=api.utils.js.map