"use strict";
var __rest = (this && this.__rest) || function (s, e) {
    var t = {};
    for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
        t[p] = s[p];
    if (s != null && typeof Object.getOwnPropertySymbols === "function")
        for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
            if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
                t[p[i]] = s[p[i]];
        }
    return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
const customers_1 = require("./resources/customers");
const measurements_1 = require("./resources/measurements");
const meters_1 = require("./resources/meters");
const priceplans_1 = require("./resources/priceplans");
const codegen_1 = require("./codegen");
const octaneDefaultHost = 'api.cloud.getoctane.io';
class Octane {
    constructor(key, overrides) {
        const _a = overrides !== null && overrides !== void 0 ? overrides : {}, { host = octaneDefaultHost, port = 443, protocol = 'https' } = _a, rest = __rest(_a, ["host", "port", "protocol"]);
        const apiConfig = new codegen_1.Configuration(Object.assign({ accessToken: key, basePath: `${protocol}://${host}:${port}` }, rest));
        this.apiConfig = apiConfig;
        this.customers = new customers_1.Customers(apiConfig);
        this.measurements = new measurements_1.Measurements(apiConfig);
        this.meters = new meters_1.Meters(apiConfig);
        this.pricePlans = new priceplans_1.PricePlans(apiConfig);
    }
    /**
     * Get the API configuration object. Useful for calling the
     * generated API files directly.
     */
    getApiConfig() {
        return this.apiConfig;
    }
}
exports.default = Octane;
const octane = function OctaneFactory(key, overrides) {
    return new Octane(key, overrides);
};
module.exports = octane;
module.exports.default = octane;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7OztBQUVBLHFEQUFrRDtBQUNsRCwyREFBd0Q7QUFDeEQsK0NBQTRDO0FBQzVDLHVEQUFvRD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