UNPKG

cloudflare

Version:

The official TypeScript library for the Cloudflare API

130 lines 4.52 kB
import { APIResource } from "../../../resource.js"; import * as Core from "../../../core.js"; export declare class EventNotifications extends APIResource { /** * Create event notification rule. */ update(bucketName: string, queueId: string, params: EventNotificationUpdateParams, options?: Core.RequestOptions): Core.APIPromise<EventNotificationUpdateResponse>; /** * Delete an event notification rule. **If no body is provided, all rules for * specified queue will be deleted**. */ delete(bucketName: string, queueId: string, params: EventNotificationDeleteParams, options?: Core.RequestOptions): Core.APIPromise<EventNotificationDeleteResponse>; /** * List all event notification rules for a bucket. */ get(bucketName: string, params: EventNotificationGetParams, options?: Core.RequestOptions): Core.APIPromise<EventNotificationGetResponse>; } export type EventNotificationUpdateResponse = unknown; export type EventNotificationDeleteResponse = unknown; export interface EventNotificationGetResponse { /** * Name of the bucket. */ bucketName?: string; /** * List of queues associated with the bucket. */ queues?: Array<EventNotificationGetResponse.Queue>; } export declare namespace EventNotificationGetResponse { interface Queue { /** * Queue ID */ queueId?: string; /** * Name of the queue */ queueName?: string; rules?: Array<Queue.Rule>; } namespace Queue { interface Rule { /** * Array of R2 object actions that will trigger notifications */ actions: Array<'PutObject' | 'CopyObject' | 'DeleteObject' | 'CompleteMultipartUpload' | 'LifecycleDeletion'>; /** * Timestamp when the rule was created */ createdAt?: string; /** * A description that can be used to identify the event notification rule after * creation */ description?: string; /** * Notifications will be sent only for objects with this prefix */ prefix?: string; /** * Rule ID */ ruleId?: string; /** * Notifications will be sent only for objects with this suffix */ suffix?: string; } } } export interface EventNotificationUpdateParams { /** * Path param: Account ID */ account_id: string; /** * Body param: Array of rules to drive notifications */ rules?: Array<EventNotificationUpdateParams.Rule>; /** * Header param: The bucket jurisdiction */ jurisdiction?: 'default' | 'eu' | 'fedramp'; } export declare namespace EventNotificationUpdateParams { interface Rule { /** * Array of R2 object actions that will trigger notifications */ actions: Array<'PutObject' | 'CopyObject' | 'DeleteObject' | 'CompleteMultipartUpload' | 'LifecycleDeletion'>; /** * A description that can be used to identify the event notification rule after * creation */ description?: string; /** * Notifications will be sent only for objects with this prefix */ prefix?: string; /** * Notifications will be sent only for objects with this suffix */ suffix?: string; } } export interface EventNotificationDeleteParams { /** * Path param: Account ID */ account_id: string; /** * Header param: The bucket jurisdiction */ jurisdiction?: 'default' | 'eu' | 'fedramp'; } export interface EventNotificationGetParams { /** * Path param: Account ID */ account_id: string; /** * Header param: The bucket jurisdiction */ jurisdiction?: 'default' | 'eu' | 'fedramp'; } export declare namespace EventNotifications { export { type EventNotificationUpdateResponse as EventNotificationUpdateResponse, type EventNotificationDeleteResponse as EventNotificationDeleteResponse, type EventNotificationGetResponse as EventNotificationGetResponse, type EventNotificationUpdateParams as EventNotificationUpdateParams, type EventNotificationDeleteParams as EventNotificationDeleteParams, type EventNotificationGetParams as EventNotificationGetParams, }; } //# sourceMappingURL=event-notifications.d.ts.map