diff --git a/spec/v2/providers/alerts/billing.spec.ts b/spec/v2/providers/alerts/billing.spec.ts index a9e4e173d..71e695fc7 100644 --- a/spec/v2/providers/alerts/billing.spec.ts +++ b/spec/v2/providers/alerts/billing.spec.ts @@ -43,9 +43,9 @@ describe('billing', () => { }); }); - describe('onAutomatedPlanUpdatePublished', () => { + describe('onPlanAutomatedUpdatePublished', () => { it('should create a function with only handler', () => { - const func = billing.onAutomatedPlanUpdatePublished(myHandler); + const func = billing.onPlanAutomatedUpdatePublished(myHandler); expect(func.__endpoint).to.deep.equal({ platform: 'gcfv2', @@ -53,7 +53,7 @@ describe('billing', () => { eventTrigger: { eventType: alerts.eventType, eventFilters: { - alertType: billing.automatedPlanUpdateAlert, + alertType: billing.planAutomatedUpdateAlert, }, retry: false, }, @@ -61,7 +61,7 @@ describe('billing', () => { }); it('should create a function with opts & handler', () => { - const func = billing.onAutomatedPlanUpdatePublished( + const func = billing.onPlanAutomatedUpdatePublished( { ...FULL_OPTIONS }, myHandler ); @@ -71,7 +71,7 @@ describe('billing', () => { eventTrigger: { eventType: alerts.eventType, eventFilters: { - alertType: billing.automatedPlanUpdateAlert, + alertType: billing.planAutomatedUpdateAlert, }, retry: false, }, diff --git a/src/v2/providers/alerts/billing.ts b/src/v2/providers/alerts/billing.ts index f2ecd4289..dd8ccb2c5 100644 --- a/src/v2/providers/alerts/billing.ts +++ b/src/v2/providers/alerts/billing.ts @@ -32,7 +32,7 @@ export type BillingEvent = CloudEvent, WithAlertType>; /** @internal */ export const planUpdateAlert = 'billing.planUpdate'; /** @internal */ -export const automatedPlanUpdateAlert = 'billing.automatedPlanUpdate'; +export const planAutomatedUpdateAlert = 'billing.planAutomatedUpdate'; /** * Declares a function that can handle a billing plan update event. @@ -60,18 +60,18 @@ export function onPlanUpdatePublished( /** * Declares a function that can handle an automated billing plan update event. */ -export function onAutomatedPlanUpdatePublished( +export function onPlanAutomatedUpdatePublished( handler: ( event: BillingEvent ) => any | Promise ): CloudFunction>; -export function onAutomatedPlanUpdatePublished( +export function onPlanAutomatedUpdatePublished( opts: options.EventHandlerOptions, handler: ( event: BillingEvent ) => any | Promise ): CloudFunction>; -export function onAutomatedPlanUpdatePublished( +export function onPlanAutomatedUpdatePublished( optsOrHandler: | options.EventHandlerOptions | ((event: BillingEvent) => any | Promise), @@ -80,7 +80,7 @@ export function onAutomatedPlanUpdatePublished( ) => any | Promise ): CloudFunction> { return onOperation( - automatedPlanUpdateAlert, + planAutomatedUpdateAlert, optsOrHandler, handler );