/// <reference types="react" />
import * as _backstage_plugin_home_react from '@backstage/plugin-home-react';
import { Entity } from '@backstage/catalog-model';
import * as React from 'react';
import React__default, { ReactNode } from 'react';
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
import { DiscoveryApi, FetchApi, ConfigApi } from '@backstage/core-plugin-api';
import { PagerDutySetting, PagerDutyEntityMappingsResponse, PagerDutyServiceResponse, PagerDutyIncidentsResponse, PagerDutyChangeEventsResponse, PagerDutyServiceStandardsResponse, PagerDutyServiceMetricsResponse, PagerDutyUser } from '@pagerduty/backstage-plugin-common';

/** @public */
declare const isPluginApplicableToEntity$1: (entity: Entity) => boolean;
/** @public */
type EntityPagerDutySmallCardProps = {
    readOnly?: boolean;
    disableInsights?: boolean;
    disableOnCall?: boolean;
};

/** @public */
declare const isPluginApplicableToEntity: (entity: Entity) => boolean;
/** @public */
type EntityPagerDutyCardProps = {
    readOnly?: boolean;
    disableChangeEvents?: boolean;
    disableOnCall?: boolean;
};

/** @public */
type PagerDutyEntity = {
    integrationKey?: string;
    serviceId?: string;
    account?: string;
    name: string;
};

/** @public */
type HomePagePagerDutyCardProps = PagerDutyEntity & {
    readOnly?: boolean;
};

/** @public */
declare const pagerDutyPlugin: _backstage_core_plugin_api.BackstagePlugin<{}, {}, {}>;
/** @public */
declare const PagerDutyPage: () => React.JSX.Element;
/** @public */
declare const EntityPagerDutyCard: (props: EntityPagerDutyCardProps) => React.JSX.Element;
/** @public */
declare const EntityPagerDutySmallCard: (props: EntityPagerDutySmallCardProps) => React.JSX.Element;
/** @public */
declare const HomePagePagerDutyCard: (props: _backstage_plugin_home_react.CardExtensionProps<HomePagePagerDutyCardProps>) => React.JSX.Element;

/** @public */
declare function PagerDutyIcon(): React__default.JSX.Element;

/** @public */
declare function TriggerButton(props: {
    children?: ReactNode;
}): React__default.JSX.Element;

/** @public */
type PagerDutyTriggerAlarmRequest = {
    integrationKey: string;
    source: string;
    description: string;
    userName: string;
};
/** @public */
interface PagerDutyApi {
    /**
     * Fetches PagerDuty setting from store.
     *
     */
    getSetting(id: string): Promise<PagerDutySetting>;
    /**
     * Stores PagerDuty setting in the database.
     *
     */
    storeSettings(settings: PagerDutySetting[]): Promise<Response>;
    /**
     * Fetches all entity mappings.
     *
     */
    getEntityMappings(): Promise<PagerDutyEntityMappingsResponse>;
    /**
     * Stores the service mapping in the database.
     *
     */
    storeServiceMapping(serviceId: string, integrationKey: string, entityRef: string, account: string): Promise<Response>;
    /**
     * Fetches the service for the provided pager duty Entity.
     *
     */
    getServiceByPagerDutyEntity(pagerDutyEntity: PagerDutyEntity): Promise<PagerDutyServiceResponse>;
    /**
     * Fetches the service for the provided Entity.
     *
     */
    getServiceByEntity(entity: Entity): Promise<PagerDutyServiceResponse>;
    /**
     * Fetches service with the provided service id.
     *
     */
    getServiceById(serviceId: string, account?: string): Promise<PagerDutyServiceResponse>;
    /**
     * Fetches a list of incidents a provided service has.
     *
     */
    getIncidentsByServiceId(serviceId: string, account?: string): Promise<PagerDutyIncidentsResponse>;
    /**
     * Fetches a list of change events a provided service has.
     *
     */
    getChangeEventsByServiceId(serviceId: string, account?: string): Promise<PagerDutyChangeEventsResponse>;
    /**
     * Fetches a list of standards for a provided service.
     *
     */
    getServiceStandardsByServiceId(serviceId: string, account?: string): Promise<PagerDutyServiceStandardsResponse>;
    /**
     * Fetches a list of metrics for a provided service.
     *
     */
    getServiceMetricsByServiceId(serviceId: string, account?: string): Promise<PagerDutyServiceMetricsResponse>;
    /**
     * Fetches the list of users in an escalation policy.
     *
     */
    getOnCallByPolicyId(policyId: string, account?: string): Promise<PagerDutyUser[]>;
    /**
     * Triggers an incident to whoever is on-call.
     */
    triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise<Response>;
}
/** @public */
type PagerDutyClientApiDependencies = {
    discoveryApi: DiscoveryApi;
    fetchApi: FetchApi;
};
/** @public */
type PagerDutyClientApiConfig = PagerDutyClientApiDependencies & {
    eventsBaseUrl?: string;
};

/** @public */
declare class UnauthorizedError extends Error {
}
/** @public */
declare const pagerDutyApiRef: _backstage_core_plugin_api.ApiRef<PagerDutyApi>;
/** @public */
declare class PagerDutyClient implements PagerDutyApi {
    private readonly config;
    static fromConfig(configApi: ConfigApi, dependencies: PagerDutyClientApiDependencies): PagerDutyClient;
    constructor(config: PagerDutyClientApiConfig);
    getServiceByPagerDutyEntity(pagerDutyEntity: PagerDutyEntity): Promise<PagerDutyServiceResponse>;
    getSetting(id: string): Promise<PagerDutySetting>;
    storeSettings(settings: PagerDutySetting[]): Promise<Response>;
    getEntityMappings(): Promise<PagerDutyEntityMappingsResponse>;
    storeServiceMapping(serviceId: string, integrationKey: string, backstageEntityRef: string, account: string): Promise<Response>;
    getServiceByEntity(entity: Entity): Promise<PagerDutyServiceResponse>;
    getServiceById(serviceId: string, account?: string): Promise<PagerDutyServiceResponse>;
    getIncidentsByServiceId(serviceId: string, account?: string): Promise<PagerDutyIncidentsResponse>;
    getChangeEventsByServiceId(serviceId: string, account?: string): Promise<PagerDutyChangeEventsResponse>;
    getServiceStandardsByServiceId(serviceId: string, account?: string): Promise<PagerDutyServiceStandardsResponse>;
    getServiceMetricsByServiceId(serviceId: string, account?: string): Promise<PagerDutyServiceMetricsResponse>;
    getOnCallByPolicyId(policyId: string, account?: string): Promise<PagerDutyUser[]>;
    triggerAlarm(request: PagerDutyTriggerAlarmRequest): Promise<Response>;
    private findByUrl;
    private request;
}

/**
 * @public
 * @deprecated Please use EntityPagerDutyCard
 */
declare const PagerDutyCard: (props: EntityPagerDutyCardProps) => React.JSX.Element;
/**
 * @public
 * @deprecated Please use EntityPagerDutyCardProps
 */
type PagerDutyCardProps = EntityPagerDutyCardProps;

export { EntityPagerDutyCard, type EntityPagerDutyCardProps, EntityPagerDutySmallCard, type EntityPagerDutySmallCardProps, HomePagePagerDutyCard, type HomePagePagerDutyCardProps, type PagerDutyApi, PagerDutyCard, type PagerDutyCardProps, PagerDutyClient, type PagerDutyClientApiConfig, type PagerDutyClientApiDependencies, type PagerDutyEntity, PagerDutyIcon, PagerDutyPage, type PagerDutyTriggerAlarmRequest, TriggerButton, UnauthorizedError, isPluginApplicableToEntity as isPagerDutyAvailable, isPluginApplicableToEntity$1 as isPagerDutySmallCardAvailable, isPluginApplicableToEntity, pagerDutyApiRef, pagerDutyPlugin, pagerDutyPlugin as plugin };
