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 extends eventgrid.EventGridEvent { data: T; } /** * Data that will be passed along in the context object to the EventGridCallback. */ export interface EventGridContext extends appservice.Context { invocationId: string; executionContext: { invocationId: string; functionName: string; functionDirectory: string; }; bindings: { message: EventGridEvent; }; bindingData: { data: T; sys: { methodName: string; utcNow: string; }; invocationId: string; }; } export interface EventGridFunctionArgs extends appservice.CallbackFunctionArgs, EventGridEvent, appservice.FunctionDefaultResponse> { } /** * Azure Function triggered by a Event Grid Topic. */ export declare class EventGridFunction extends appservice.Function, EventGridEvent, appservice.FunctionDefaultResponse> { constructor(name: string, args: EventGridFunctionArgs); } export interface EventGridCallbackSubscriptionArgs extends appservice.CallbackFunctionAppArgs, EventGridEvent, 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; /** * A list of applicable event types that need to be part of the event subscription. */ readonly includedEventTypes?: pulumi.Input[]>; /** * A retry policy block as defined below. */ readonly retryPolicy?: pulumi.Input<{ eventTimeToLive: pulumi.Input; maxDeliveryAttempts: pulumi.Input; }>; /** * A subject filter block as defined below. */ readonly subjectFilter?: pulumi.Input<{ caseSensitive?: pulumi.Input; subjectBeginsWith?: pulumi.Input; subjectEndsWith?: pulumi.Input; }>; } /** * 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; /** * Azure Resource ID. */ id: pulumi.Input; } /** * 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 extends appservice.EventSubscription, EventGridEvent, appservice.FunctionDefaultResponse> { readonly subscription: EventSubscription; constructor(name: string, scope: EventGridScope, args: EventGridCallbackSubscriptionArgs, opts?: pulumi.ComponentResourceOptions); } export interface StorageAccountEventGridCallbackSubscriptionArgs extends EventGridCallbackSubscriptionArgs { /** * 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 { /** * 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, opts?: pulumi.ComponentResourceOptions): EventGridCallbackSubscription; /** * 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, opts?: pulumi.ComponentResourceOptions): EventGridCallbackSubscription; /** * 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; } export {};