import * as pulumi from "@pulumi/pulumi";
import * as eventgrid from "@azure/eventgrid";
import * as appservice from "../appservice";
import { ResourceGroup } from "../core";
import { Account } from "../storage";
import { EventSubscription } from "./eventSubscription";
/**
 * Event that will be passed along to the EventGridCallback.
 */
export interface EventGridEvent<T> extends eventgrid.EventGridEvent<T> {
    data: T;
}
/**
 * Data that will be passed along in the context object to the EventGridCallback.
 */
export interface EventGridContext<T> extends appservice.Context<appservice.FunctionDefaultResponse> {
    invocationId: string;
    executionContext: {
        invocationId: string;
        functionName: string;
        functionDirectory: string;
    };
    bindings: {
        message: EventGridEvent<T>;
    };
    bindingData: {
        data: T;
        sys: {
            methodName: string;
            utcNow: string;
        };
        invocationId: string;
    };
}
export interface EventGridFunctionArgs<T> extends appservice.CallbackFunctionArgs<EventGridContext<T>, EventGridEvent<T>, appservice.FunctionDefaultResponse> {
}
/**
 * Azure Function triggered by a Event Grid Topic.
 */
export declare class EventGridFunction<T> extends appservice.Function<EventGridContext<T>, EventGridEvent<T>, appservice.FunctionDefaultResponse> {
    constructor(name: string, args: EventGridFunctionArgs<T>);
}
export interface EventGridCallbackSubscriptionArgs<T> extends appservice.CallbackFunctionAppArgs<EventGridContext<T>, EventGridEvent<T>, appservice.FunctionDefaultResponse> {
    /**
     * The name of the resource group in which to create the event subscription. [resourceGroup] takes precedence
     * over [resourceGroupName]. If none of the two is supplied, the Queue's resource group will be used.
     */
    resourceGroupName?: pulumi.Input<string>;
    /**
     * A list of applicable event types that need to be part of the event subscription.
     */
    readonly includedEventTypes?: pulumi.Input<pulumi.Input<string>[]>;
    /**
     * A retry policy block as defined below.
     */
    readonly retryPolicy?: pulumi.Input<{
        eventTimeToLive: pulumi.Input<number>;
        maxDeliveryAttempts: pulumi.Input<number>;
    }>;
    /**
     * A subject filter block as defined below.
     */
    readonly subjectFilter?: pulumi.Input<{
        caseSensitive?: pulumi.Input<boolean>;
        subjectBeginsWith?: pulumi.Input<string>;
        subjectEndsWith?: pulumi.Input<string>;
    }>;
}
/**
 * Resource properties to scope an Event Grid subscription to. The shape fits most Azure resources,
 * so they can be passed directly.
 */
export interface EventGridScope {
    /**
     * Resource group name to create subscription at, if another resource group is not explicitly
     * passed in subscription arguments.
     */
    resourceGroupName: pulumi.Input<string>;
    /**
     * Azure Resource ID.
     */
    id: pulumi.Input<string>;
}
/**
 * A callback-based subscription to events coming from Event Grid. Creates an Azure Function and
 * an Event Grid Event Subscription with the webhook URL pointing to the Azure Function.
 */
export declare class EventGridCallbackSubscription<T> extends appservice.EventSubscription<EventGridContext<T>, EventGridEvent<T>, appservice.FunctionDefaultResponse> {
    readonly subscription: EventSubscription;
    constructor(name: string, scope: EventGridScope, args: EventGridCallbackSubscriptionArgs<T>, opts?: pulumi.ComponentResourceOptions);
}
export interface StorageAccountEventGridCallbackSubscriptionArgs<T> extends EventGridCallbackSubscriptionArgs<T> {
    /**
     * Storage Account to subscribe to. Event Grid events for this account trigger the callback execution.
     */
    readonly storageAccount: Account;
}
/**
 * Possible types of Event Grid events for a Resource Group.
 */
type ResourceGroupEvent = eventgrid.ResourceActionCancelEventData | eventgrid.ResourceActionFailureEventData | eventgrid.ResourceActionSuccessEventData | eventgrid.ResourceDeleteCancelEventData | eventgrid.ResourceDeleteFailureEventData | eventgrid.ResourceDeleteSuccessEventData | eventgrid.ResourceWriteCancelEventData | eventgrid.ResourceWriteFailureEventData | eventgrid.ResourceWriteSuccessEventData;
export interface ResourceGroupEventGridCallbackSubscriptionArgs extends EventGridCallbackSubscriptionArgs<ResourceGroupEvent> {
    /**
     * Resource Group to subscribe to. Event Grid events for this resource group trigger the callback execution.
     */
    readonly resourceGroup: ResourceGroup;
}
/**
 * Contains hooks to subscribe to different kinds of Event Grid events.
 */
export declare namespace events {
    /**
     * Creates a new subscription to events fired from Event Grid. The callback is executed whenever
     * a new Blob is created in a container of the Storage Account.
     */
    function onGridBlobCreated(name: string, args: StorageAccountEventGridCallbackSubscriptionArgs<eventgrid.StorageBlobCreatedEventData>, opts?: pulumi.ComponentResourceOptions): EventGridCallbackSubscription<eventgrid.StorageBlobCreatedEventData>;
    /**
     * Creates a new subscription to events fired from Event Grid. The callback is executed whenever
     * a Blob is deleted from a container of the Storage Account.
     */
    function onGridBlobDeleted(name: string, args: StorageAccountEventGridCallbackSubscriptionArgs<eventgrid.StorageBlobDeletedEventData>, opts?: pulumi.ComponentResourceOptions): EventGridCallbackSubscription<eventgrid.StorageBlobDeletedEventData>;
    /**
     * Creates a new subscription to events fired from Event Grid. The callback is executed whenever
     * an event associated with the Resource Group fires.
     */
    function onResourceGroupEvent(name: string, args: ResourceGroupEventGridCallbackSubscriptionArgs, opts?: pulumi.ComponentResourceOptions): EventGridCallbackSubscription<ResourceGroupEvent>;
}
export {};
//# sourceMappingURL=zMixins.d.ts.map