UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

33 lines 1.9 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.__unused = void 0; const bucket_1 = require("./bucket"); const cloudfunctions = require("../cloudfunctions"); bucket_1.Bucket.prototype.onObjectFinalized = function (name, handler, args, opts) { return this.onObjectEvent(name, handler, Object.assign(Object.assign({}, args), { triggerType: "finalize" }), opts); }; bucket_1.Bucket.prototype.onObjectDeleted = function (name, handler, args, opts) { return this.onObjectEvent(name, handler, Object.assign(Object.assign({}, args), { triggerType: "delete" }), opts); }; bucket_1.Bucket.prototype.onObjectArchived = function (name, handler, args, opts) { return this.onObjectEvent(name, handler, Object.assign(Object.assign({}, args), { triggerType: "archive" }), opts); }; bucket_1.Bucket.prototype.onObjectMetadataUpdated = function (name, handler, args, opts) { return this.onObjectEvent(name, handler, Object.assign(Object.assign({}, args), { triggerType: "metadataUpdate" }), opts); }; bucket_1.Bucket.prototype.onObjectEvent = function (name, handlerOrCallbackArgs, args, opts = {}) { const callbackArgs = handlerOrCallbackArgs instanceof Function ? { callback: handlerOrCallbackArgs } : handlerOrCallbackArgs; return new cloudfunctions.CallbackFunction(name, Object.assign(Object.assign({}, callbackArgs), { eventTrigger: { resource: this.name, failurePolicy: args.failurePolicy, eventType: `google.storage.object.${args.triggerType}`, } }), Object.assign({ parent: this }, opts)); }; // Needed so that typescript won't elide this module /** @internal */ exports.__unused = 0; //# sourceMappingURL=zMixins.js.map