"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.cloudfrontMetricPropsToMetricProps = void 0;
const aws_cdk_lib_1 = require("aws-cdk-lib");
/**
 * Helper for mapping IApiMetricProps to actual metric props, with defaults for optionals
 */
const cloudfrontMetricPropsToMetricProps = (props, metricName, label, statistic) => {
    var _a;
    return ({
        metricName,
        label,
        statistic,
        namespace: 'AWS/CloudFront',
        dimensionsMap: { Region: 'Global', DistributionId: props.distributionId },
        period: (_a = props.period) !== null && _a !== void 0 ? _a : aws_cdk_lib_1.Duration.minutes(5),
        color: props.color,
    });
};
exports.cloudfrontMetricPropsToMetricProps = cloudfrontMetricPropsToMetricProps;
