/// import * as pulumi from "@pulumi/pulumi"; /** * BucketHandlerArgs are the arguments passed to an [onPut] or [onDelete] handler. */ export interface BucketHandlerArgs { /** * The key that was updated or deleted by the operation. */ key: string; /** * The size, in bytes, of the blob that was [put]. */ size: number; /** * The time (in ISO-8601 format) when the [put] or [delete] was completed. */ eventTime: string; } /** * BucketHandler is the callback that handles an [onPut] or [onDelete] event. */ export declare type BucketHandler = (args: BucketHandlerArgs) => Promise; /** * BucketFilter specifies filters to apply to an [onPut] or [onDelete] subscription. */ export interface BucketFilter { keyPrefix?: string; keySuffix?: string; } export interface BucketConstructor { /** * Creates a new Bucket. * * @param name A unique name for the bucket. * @param opts A bag of options that controls how this resource behaves. */ new (name: string, opts?: pulumi.ResourceOptions): Bucket; } export declare let Bucket: BucketConstructor; /** * Bucket is a simple blob store. * * Gets are read-after-write consistent for puts of new blobs, and eventually consistent for overwriting puts. * * Blobs in a bucket are encrypted at rest by default. */ export interface Bucket { /** * Registers a handler to be notified when blobs are put into the bucket (created or updated). * * @param name A unique name for the subscription. * @param filter A filter to decide which put events should be reported. * @param handler A callback to handle the event. */ onPut(name: string, handler: BucketHandler, filter?: BucketFilter): void; /** * Registers a handler to be notified when blobs are deleted from the bucket. * * @param name A unique name for the subscription. * @param filter A filter to decide which put events should be reported. * @param handler A callback to handle the event. */ onDelete(name: string, handler: BucketHandler, filter?: BucketFilter): void; /** * Get a blob from the bucket. * * @param key The key of the blog to retrieve. * @returns A promise for the success or failure of the get. */ get(key: string): Promise; /** * Insert a blob into the bucket. * * @param key The key to use for retreiving this blob later. * @returns A promise for the success or failure of the put. */ put(key: string, contents: Buffer): Promise; /** * Delete a blob from the bucket. * * @param key The key of the blob to delete. * @returns A promise for the success or failure of the delete. */ delete(key: string): Promise; }