/
GoogleCloudEvent.ts
167 lines (154 loc) · 4.81 KB
/
GoogleCloudEvent.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
/* eslint-disable @typescript-eslint/no-explicit-any*/
import {LogEntryData} from './cloud/audit/v1/LogEntryData';
import {BuildEventData} from './cloud/cloudbuild/v1/BuildEventData';
import {DocumentEventData} from './cloud/firestore/v1/DocumentEventData';
import {MessagePublishedData} from './cloud/pubsub/v1/MessagePublishedData';
import {SchedulerJobData} from './cloud/scheduler/v1/SchedulerJobData';
import {StorageObjectData} from './cloud/storage/v1/StorageObjectData';
import {AnalyticsLogData} from './firebase/analytics/v1/AnalyticsLogData';
import {AuthEventData} from './firebase/auth/v1/AuthEventData';
import {ReferenceEventData} from './firebase/database/v1/ReferenceEventData';
import {RemoteConfigEventData} from './firebase/remoteconfig/v1/RemoteConfigEventData';
import {TestMatrixEventData} from './firebase/testlab/v1/TestMatrixEventData';
import {CloudEvent} from './CloudEvent';
/**
* The schema of CloudEvents emmitted by Cloud Audit Logs.
*
* @public
*/
export interface LogEntryCloudEvent extends CloudEvent {
type: 'google.cloud.audit.log.v1.written';
data: LogEntryData;
}
/**
* The schema of CloudEvents emmitted by Cloud Build.
*
* @public
*/
export interface BuildEventCloudEvent extends CloudEvent {
type: 'google.cloud.cloudbuild.build.v1.statusChanged';
data: BuildEventData;
}
/**
* The schema of CloudEvents emmitted by Cloud Firestore.
*
* @public
*/
export interface DocumentEventCloudEvent extends CloudEvent {
type:
| 'google.cloud.firestore.document.v1.created'
| 'google.cloud.firestore.document.v1.updated'
| 'google.cloud.firestore.document.v1.deleted'
| 'google.cloud.firestore.document.v1.written';
data: DocumentEventData;
}
/**
* The schema of CloudEvents emmitted by Cloud Pub/Sub.
*
* @public
*/
export interface MessagePublishedCloudEvent extends CloudEvent {
type: 'google.cloud.pubsub.topic.v1.messagePublished';
data: MessagePublishedData;
}
/**
* The schema of CloudEvents emmitted by Cloud Scheduler.
*
* @public
*/
export interface SchedulerJobCloudEvent extends CloudEvent {
type: 'google.cloud.scheduler.job.v1.executed';
data: SchedulerJobData;
}
/**
* The schema of CloudEvents emmitted by Cloud Storage.
*
* @public
*/
export interface StorageObjectCloudEvent extends CloudEvent {
type:
| 'google.cloud.storage.object.v1.finalized'
| 'google.cloud.storage.object.v1.archived'
| 'google.cloud.storage.object.v1.deleted'
| 'google.cloud.storage.object.v1.metadataUpdated';
data: StorageObjectData;
}
/**
* The schema of CloudEvents emmitted by Google Analytics for Firebase.
*
* @public
*/
export interface AnalyticsLogCloudEvent extends CloudEvent {
type: 'google.firebase.analytics.log.v1.written';
data: AnalyticsLogData;
}
/**
* The schema of CloudEvents emmitted by Firebase Authentication.
*
* @public
*/
export interface AuthEventCloudEvent extends CloudEvent {
type:
| 'google.firebase.auth.user.v1.created'
| 'google.firebase.auth.user.v1.deleted';
data: AuthEventData;
}
/**
* The schema of CloudEvents emmitted by Firebase Realtime Database.
*
* @public
*/
export interface ReferenceEventCloudEvent extends CloudEvent {
type:
| 'google.firebase.database.ref.v1.created'
| 'google.firebase.database.ref.v1.updated'
| 'google.firebase.database.ref.v1.deleted'
| 'google.firebase.database.ref.v1.written';
data: ReferenceEventData;
}
/**
* The schema of CloudEvents emmitted by Firebase Remote Config.
*
* @public
*/
export interface RemoteConfigEventCloudEvent extends CloudEvent {
type: 'google.firebase.remoteconfig.remoteConfig.v1.updated';
data: RemoteConfigEventData;
}
/**
* The schema of CloudEvents emmitted by Firebase Test Lab.
*
* @public
*/
export interface TestMatrixEventCloudEvent extends CloudEvent {
type: 'google.firebase.testlab.testMatrix.v1.completed';
data: TestMatrixEventData;
}
/**
* Union of all known CloudEvents emitted by Google Cloud services
*/
export type GoogleCloudEvent =
| LogEntryCloudEvent
| BuildEventCloudEvent
| DocumentEventCloudEvent
| MessagePublishedCloudEvent
| SchedulerJobCloudEvent
| StorageObjectCloudEvent
| AnalyticsLogCloudEvent
| AuthEventCloudEvent
| ReferenceEventCloudEvent
| RemoteConfigEventCloudEvent
| TestMatrixEventCloudEvent;