import type { Except } from 'type-fest';
import type { BasicMetaSysProps, DefaultElements, Link, MakeRequest, SysLink } from '../common-types';
import type { ParameterDefinition } from './widget-parameters';
type AppActionSys = Except<BasicMetaSysProps, 'version'> & {
    appDefinition: SysLink;
    organization: SysLink;
};
export type AppActionParameterDefinition = Omit<ParameterDefinition, 'labels'>;
export type AppActionCategoryProps = {
    sys: {
        id: AppActionCategoryType;
        type: 'AppActionCategory';
        version: string;
    };
    name: string;
    description: string;
    parameters?: AppActionParameterDefinition[];
};
type BuiltInCategoriesProps = {
    /**
     * Category identifying the shape of the action.
     */
    category: 'Entries.v1.0' | 'Notification.v1.0';
};
type CustomAppActionProps = {
    /**
     * "Custom" category requires "parameters"
     */
    category: 'Custom';
    parameters: AppActionParameterDefinition[];
};
type AppActionCategory = BuiltInCategoriesProps | CustomAppActionProps;
export type AppActionCategoryType = AppActionCategory['category'];
/**
 * 'function' is deprecated, use 'function-invocation' instead
 */
export type AppActionType = 'endpoint' | 'function' | 'function-invocation';
type BaseAppActionProps = AppActionCategory & {
    /**
     * System metadata
     */
    sys: AppActionSys;
    /**
     * Human readable name for the action
     */
    name: string;
    /**
     * Human readable description of the action
     */
    description?: string;
    /**
     * Optional JSON Schema describing the request payload shape
     */
    parametersSchema?: Record<string, unknown>;
    /**
     * Optional JSON Schema describing the result shape
     */
    resultSchema?: Record<string, unknown>;
};
type CreateEndpointAppActionProps = {
    /**
     * Type of the action, defaults to endpoint if not provided
     * endpoint: action is sent to specified URL
     */
    type?: 'endpoint';
    /**
     * Url that will be called when the action is invoked
     */
    url: string;
};
type EndpointAppActionProps = {
    /**
     * Type of the action
     * endpoint: action is sent to specified URL
     */
    type: 'endpoint';
    /**
     * Url that will be called when the action is invoked
     */
    url: string;
};
type CreateFunctionAppActionProps = {
    /**
     * Type of the action
     * function-invocation: action invokes a contentful function
     */
    type: 'function-invocation';
    /**
     * Link to a Function
     */
    function: Link<'Function'>;
    /**
     * ID of the action
     */
    id?: string;
};
type FunctionAppActionProps = {
    /**
     * Type of the action
     * function-invocation: action invokes a contentful function
     */
    type: 'function-invocation';
    /**
     * Link to a Function
     */
    function: Link<'Function'>;
};
/**
 * @deprecated Use FunctionAppActionProps instead
 */
type LegacyFunctionAppActionProps = Record<string, unknown> & {
    type: 'function';
};
export type CreateAppActionProps = AppActionCategory & {
    name: string;
    description?: string;
    /**
     * Optional JSON Schema describing the request payload shape
     */
    parametersSchema?: Record<string, unknown>;
    /**
     * Optional JSON Schema describing the result shape
     */
    resultSchema?: Record<string, unknown>;
} & (CreateEndpointAppActionProps | CreateFunctionAppActionProps | LegacyFunctionAppActionProps);
export type AppActionProps = BaseAppActionProps & (EndpointAppActionProps | FunctionAppActionProps | LegacyFunctionAppActionProps);
export type AppAction = AppActionProps & DefaultElements<AppActionProps> & {
    /**
     * Deletes this object on the server.
     * @returns Promise for the deletion. It contains no data, but the Promise error case should be handled.
     * @example ```javascript
     * const contentful = require('contentful-management')
     *
     * const client = contentful.createClient({
     *   accessToken: '<content_management_api_key>'
     * })
     *
     * client.getOrganization('<org_id>')
     * .then((org) => org.getAppDefinition('<app_def_id>'))
     * .then((appDefinition) => appDefinition.getAppAction('<app-action-id>'))
     * .then((appAction) => appAction.delete())
     * .catch(console.error)
     * ```
     */
    delete(): Promise<void>;
};
/**
 * @internal
 * @param makeRequest - function to make requests via an adapter
 * @param data - Raw App Bundle data
 * @returns Wrapped App Bundle data
 */
export declare function wrapAppAction(makeRequest: MakeRequest, data: AppActionProps): AppAction;
/**
 * @internal
 * @param makeRequest - function to make requests via an adapter
 * @param data - Raw App Bundle collection data
 * @returns Wrapped App Bundle collection data
 */
export declare const wrapAppActionCollection: (makeRequest: MakeRequest, data: import("..").CollectionProp<AppActionProps>) => import("..").Collection<AppAction, AppActionProps>;
export {};
