"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApiMethodErrorsWidget = void 0;
const aws_cdk_lib_1 = require("aws-cdk-lib");
const metrics_1 = require("../../metrics");
class ApiMethodErrorsWidget extends aws_cdk_lib_1.aws_cloudwatch.GraphWidget {
    constructor(props) {
        const { apiName, stage, horizontalAnnotations, duration } = props;
        super({
            title: 'Method 5XX Errors',
            width: 6,
            height: 4,
            left: [new metrics_1.ApiMethodErrorsMetric({ apiName, stage, period: duration })],
            legendPosition: aws_cdk_lib_1.aws_cloudwatch.LegendPosition.HIDDEN,
            leftAnnotations: horizontalAnnotations !== null && horizontalAnnotations !== void 0 ? horizontalAnnotations : [],
            leftYAxis: { label: 'Percent', showUnits: false, min: 0, max: 100 },
        });
    }
}
exports.ApiMethodErrorsWidget = ApiMethodErrorsWidget;
