@@ -4,7 +4,7 @@ import * as options from '../../options';
44
55/**
66 * The internal payload object for billing plan updates.
7- * Payload is wrapped inside a FirebaseAlertData object.
7+ * Payload is wrapped inside a ` FirebaseAlertData` object.
88 */
99export interface PlanUpdatePayload {
1010 [ '@type' ] : 'type.googleapis.com/google.events.firebase.firebasealerts.v1.BillingPlanUpdatePayload' ;
@@ -18,7 +18,7 @@ export interface PlanUpdatePayload {
1818
1919/**
2020 * The internal payload object for billing plan automated updates.
21- * Payload is wrapped inside a FirebaseAlertData object.
21+ * Payload is wrapped inside a ` FirebaseAlertData` object.
2222 */
2323export interface PlanAutomatedUpdatePayload {
2424 [ '@type' ] : 'type.googleapis.com/google.events.firebase.firebasealerts.v1.BillingPlanAutomatedUpdatePayload' ;
@@ -30,6 +30,7 @@ export interface PlanAutomatedUpdatePayload {
3030
3131/**
3232 * A custom CloudEvent for billing Firebase Alerts (with custom extension attributes).
33+ * @typeParam T - the data type for billing alerts that is wrapped in a `FirebaseAlertData` object.
3334 */
3435export interface BillingEvent < T > extends CloudEvent < FirebaseAlertData < T > > {
3536 /** The type of the alerts that got triggered. */
@@ -43,14 +44,30 @@ export const planAutomatedUpdateAlert = 'billing.planAutomatedUpdate';
4344
4445/**
4546 * Declares a function that can handle a billing plan update event.
47+ * @param handler - Event handler which is run every time a billing plan is updated.
48+ * @returns A function that you can export and deploy.
4649 */
4750export function onPlanUpdatePublished (
4851 handler : ( event : BillingEvent < PlanUpdatePayload > ) => any | Promise < any >
4952) : CloudFunction < BillingEvent < PlanUpdatePayload > > ;
53+
54+ /**
55+ * Declares a function that can handle a billing plan update event.
56+ * @param opts - Options that can be set on the function.
57+ * @param handler - Event handler which is run every time a billing plan is updated.
58+ * @returns A function that you can export and deploy.
59+ */
5060export function onPlanUpdatePublished (
5161 opts : options . EventHandlerOptions ,
5262 handler : ( event : BillingEvent < PlanUpdatePayload > ) => any | Promise < any >
5363) : CloudFunction < BillingEvent < PlanUpdatePayload > > ;
64+
65+ /**
66+ * Declares a function that can handle a billing plan update event.
67+ * @param optsOrHandler - Options or an event-handling function.
68+ * @param handler - Event handler which is run every time a billing plan is updated.
69+ * @returns A function that you can export and deploy.
70+ */
5471export function onPlanUpdatePublished (
5572 optsOrHandler :
5673 | options . EventHandlerOptions
@@ -66,18 +83,34 @@ export function onPlanUpdatePublished(
6683
6784/**
6885 * Declares a function that can handle an automated billing plan update event.
86+ * @param handler - Event handler which is run every time an automated billing plan update occurs.
87+ * @returns A function that you can export and deploy.
6988 */
7089export function onPlanAutomatedUpdatePublished (
7190 handler : (
7291 event : BillingEvent < PlanAutomatedUpdatePayload >
7392 ) => any | Promise < any >
7493) : CloudFunction < BillingEvent < PlanAutomatedUpdatePayload > > ;
94+
95+ /**
96+ * Declares a function that can handle an automated billing plan update event.
97+ * @param opts - Options that can be set on the function.
98+ * @param handler - Event handler which is run every time an automated billing plan update occurs.
99+ * @returns A function that you can export and deploy.
100+ */
75101export function onPlanAutomatedUpdatePublished (
76102 opts : options . EventHandlerOptions ,
77103 handler : (
78104 event : BillingEvent < PlanAutomatedUpdatePayload >
79105 ) => any | Promise < any >
80106) : CloudFunction < BillingEvent < PlanAutomatedUpdatePayload > > ;
107+
108+ /**
109+ * Declares a function that can handle an automated billing plan update event.
110+ * @param optsOrHandler - Options or an event-handling function.
111+ * @param handler - Event handler which is run every time an automated billing plan update occurs.
112+ * @returns A function that you can export and deploy.
113+ */
81114export function onPlanAutomatedUpdatePublished (
82115 optsOrHandler :
83116 | options . EventHandlerOptions
0 commit comments